static int ffserver_parse_config_global(FFServerConfig *config, const char *cmd,

                                        const char **p, int line_num)

{

    int val;

    char arg[1024];

    if (!av_strcasecmp(cmd, "Port") || !av_strcasecmp(cmd, "HTTPPort")) {

        if (!av_strcasecmp(cmd, "Port"))

            WARNING("Port option is deprecated, use HTTPPort instead\n");

        ffserver_get_arg(arg, sizeof(arg), p);

        val = atoi(arg);

        if (val < 1 || val > 65536)

            ERROR("Invalid port: %s\n", arg);

        if (val < 1024)

            WARNING("Trying to use IETF assigned system port: %d\n", val);

        config->http_addr.sin_port = htons(val);

    } else if (!av_strcasecmp(cmd, "HTTPBindAddress") || !av_strcasecmp(cmd, "BindAddress")) {

        if (!av_strcasecmp(cmd, "BindAddress"))

            WARNING("BindAddress option is deprecated, use HTTPBindAddress instead\n");

        ffserver_get_arg(arg, sizeof(arg), p);

        if (resolve_host(&config->http_addr.sin_addr, arg) != 0)

            ERROR("%s:%d: Invalid host/IP address: %s\n", arg);

    } else if (!av_strcasecmp(cmd, "NoDaemon")) {

        WARNING("NoDaemon option has no effect, you should remove it\n");

    } else if (!av_strcasecmp(cmd, "RTSPPort")) {

        ffserver_get_arg(arg, sizeof(arg), p);

        val = atoi(arg);

        if (val < 1 || val > 65536)

            ERROR("%s:%d: Invalid port: %s\n", arg);

        config->rtsp_addr.sin_port = htons(atoi(arg));

    } else if (!av_strcasecmp(cmd, "RTSPBindAddress")) {

        ffserver_get_arg(arg, sizeof(arg), p);

        if (resolve_host(&config->rtsp_addr.sin_addr, arg) != 0)

            ERROR("Invalid host/IP address: %s\n", arg);

    } else if (!av_strcasecmp(cmd, "MaxHTTPConnections")) {

        ffserver_get_arg(arg, sizeof(arg), p);

        val = atoi(arg);

        if (val < 1 || val > 65536)

            ERROR("Invalid MaxHTTPConnections: %s\n", arg);

        config->nb_max_http_connections = val;

    } else if (!av_strcasecmp(cmd, "MaxClients")) {

        ffserver_get_arg(arg, sizeof(arg), p);

        val = atoi(arg);

        if (val < 1 || val > config->nb_max_http_connections)

            ERROR("Invalid MaxClients: %s\n", arg);

        else

            config->nb_max_connections = val;

    } else if (!av_strcasecmp(cmd, "MaxBandwidth")) {

        int64_t llval;

        ffserver_get_arg(arg, sizeof(arg), p);

        llval = strtoll(arg, NULL, 10);

        if (llval < 10 || llval > 10000000)

            ERROR("Invalid MaxBandwidth: %s\n", arg);

        else

            config->max_bandwidth = llval;

    } else if (!av_strcasecmp(cmd, "CustomLog")) {

        if (!config->debug)

            ffserver_get_arg(config->logfilename, sizeof(config->logfilename), p);

    } else if (!av_strcasecmp(cmd, "LoadModule")) {

        ERROR("Loadable modules no longer supported\n");

    } else

        ERROR("Incorrect keyword: '%s'\n", cmd);

    return 0;

}

static int ffserver_parse_config_global(FFServerConfig *config, const char *cmd,

                                        const char **p, int line_num)

{

    int val;

    char arg[1024];

    if (!av_strcasecmp(cmd, "Port") || !av_strcasecmp(cmd, "HTTPPort")) {

        if (!av_strcasecmp(cmd, "Port"))

            WARNING("Port option is deprecated, use HTTPPort instead\n");

        ffserver_get_arg(arg, sizeof(arg), p);

        val = atoi(arg);

        if (val < 1 || val > 65536)

            ERROR("Invalid port: %s\n", arg);

        if (val < 1024)

            WARNING("Trying to use IETF assigned system port: %d\n", val);

        config->http_addr.sin_port = htons(val);

    } else if (!av_strcasecmp(cmd, "HTTPBindAddress") || !av_strcasecmp(cmd, "BindAddress")) {

        if (!av_strcasecmp(cmd, "BindAddress"))

            WARNING("BindAddress option is deprecated, use HTTPBindAddress instead\n");

        ffserver_get_arg(arg, sizeof(arg), p);

        if (resolve_host(&config->http_addr.sin_addr, arg) != 0)

            ERROR("%s:%d: Invalid host/IP address: %s\n", arg);

    } else if (!av_strcasecmp(cmd, "NoDaemon")) {

        WARNING("NoDaemon option has no effect, you should remove it\n");

    } else if (!av_strcasecmp(cmd, "RTSPPort")) {

        ffserver_get_arg(arg, sizeof(arg), p);

        val = atoi(arg);

        if (val < 1 || val > 65536)

            ERROR("%s:%d: Invalid port: %s\n", arg);

        config->rtsp_addr.sin_port = htons(atoi(arg));

    } else if (!av_strcasecmp(cmd, "RTSPBindAddress")) {

        ffserver_get_arg(arg, sizeof(arg), p);

        if (resolve_host(&config->rtsp_addr.sin_addr, arg) != 0)

            ERROR("Invalid host/IP address: %s\n", arg);

    } else if (!av_strcasecmp(cmd, "MaxHTTPConnections")) {

        ffserver_get_arg(arg, sizeof(arg), p);

        val = atoi(arg);

        if (val < 1 || val > 65536)

            ERROR("Invalid MaxHTTPConnections: %s\n", arg);

        config->nb_max_http_connections = val;

    } else if (!av_strcasecmp(cmd, "MaxClients")) {

        ffserver_get_arg(arg, sizeof(arg), p);

        val = atoi(arg);

        if (val < 1 || val > config->nb_max_http_connections)

            ERROR("Invalid MaxClients: %s\n", arg);

        else

            config->nb_max_connections = val;

    } else if (!av_strcasecmp(cmd, "MaxBandwidth")) {

        int64_t llval;

        ffserver_get_arg(arg, sizeof(arg), p);

        llval = strtoll(arg, NULL, 10);

        if (llval < 10 || llval > 10000000)

            ERROR("Invalid MaxBandwidth: %s\n", arg);

        else

            config->max_bandwidth = llval;

    } else if (!av_strcasecmp(cmd, "CustomLog")) {

        if (!config->debug)

            ffserver_get_arg(config->logfilename, sizeof(config->logfilename), p);

    } else if (!av_strcasecmp(cmd, "LoadModule")) {

        ERROR("Loadable modules no longer supported\n");

    } else

        ERROR("Incorrect keyword: '%s'\n", cmd);

    return 0;

}

static int FUNC_0(FFServerConfig *VAR_0, const char *VAR_1,

                                        const char **VAR_2, int VAR_3)

{

    int VAR_4;

    char VAR_5[1024];

    if (!av_strcasecmp(VAR_1, "Port") || !av_strcasecmp(VAR_1, "HTTPPort")) {

        if (!av_strcasecmp(VAR_1, "Port"))

            WARNING("Port option is deprecated, use HTTPPort instead\n");

        ffserver_get_arg(VAR_5, sizeof(VAR_5), VAR_2);

        VAR_4 = atoi(VAR_5);

        if (VAR_4 < 1 || VAR_4 > 65536)

            ERROR("Invalid port: %s\n", VAR_5);

        if (VAR_4 < 1024)

            WARNING("Trying to use IETF assigned system port: %d\n", VAR_4);

        VAR_0->http_addr.sin_port = htons(VAR_4);

    } else if (!av_strcasecmp(VAR_1, "HTTPBindAddress") || !av_strcasecmp(VAR_1, "BindAddress")) {

        if (!av_strcasecmp(VAR_1, "BindAddress"))

            WARNING("BindAddress option is deprecated, use HTTPBindAddress instead\n");

        ffserver_get_arg(VAR_5, sizeof(VAR_5), VAR_2);

        if (resolve_host(&VAR_0->http_addr.sin_addr, VAR_5) != 0)

            ERROR("%s:%d: Invalid host/IP address: %s\n", VAR_5);

    } else if (!av_strcasecmp(VAR_1, "NoDaemon")) {

        WARNING("NoDaemon option has no effect, you should remove it\n");

    } else if (!av_strcasecmp(VAR_1, "RTSPPort")) {

        ffserver_get_arg(VAR_5, sizeof(VAR_5), VAR_2);

        VAR_4 = atoi(VAR_5);

        if (VAR_4 < 1 || VAR_4 > 65536)

            ERROR("%s:%d: Invalid port: %s\n", VAR_5);

        VAR_0->rtsp_addr.sin_port = htons(atoi(VAR_5));

    } else if (!av_strcasecmp(VAR_1, "RTSPBindAddress")) {

        ffserver_get_arg(VAR_5, sizeof(VAR_5), VAR_2);

        if (resolve_host(&VAR_0->rtsp_addr.sin_addr, VAR_5) != 0)

            ERROR("Invalid host/IP address: %s\n", VAR_5);

    } else if (!av_strcasecmp(VAR_1, "MaxHTTPConnections")) {

        ffserver_get_arg(VAR_5, sizeof(VAR_5), VAR_2);

        VAR_4 = atoi(VAR_5);

        if (VAR_4 < 1 || VAR_4 > 65536)

            ERROR("Invalid MaxHTTPConnections: %s\n", VAR_5);

        VAR_0->nb_max_http_connections = VAR_4;

    } else if (!av_strcasecmp(VAR_1, "MaxClients")) {

        ffserver_get_arg(VAR_5, sizeof(VAR_5), VAR_2);

        VAR_4 = atoi(VAR_5);

        if (VAR_4 < 1 || VAR_4 > VAR_0->nb_max_http_connections)

            ERROR("Invalid MaxClients: %s\n", VAR_5);

        else

            VAR_0->nb_max_connections = VAR_4;

    } else if (!av_strcasecmp(VAR_1, "MaxBandwidth")) {

        int64_t llval;

        ffserver_get_arg(VAR_5, sizeof(VAR_5), VAR_2);

        llval = strtoll(VAR_5, NULL, 10);

        if (llval < 10 || llval > 10000000)

            ERROR("Invalid MaxBandwidth: %s\n", VAR_5);

        else

            VAR_0->max_bandwidth = llval;

    } else if (!av_strcasecmp(VAR_1, "CustomLog")) {

        if (!VAR_0->debug)

            ffserver_get_arg(VAR_0->logfilename, sizeof(VAR_0->logfilename), VAR_2);

    } else if (!av_strcasecmp(VAR_1, "LoadModule")) {

        ERROR("Loadable modules no longer supported\n");

    } else

        ERROR("Incorrect keyword: '%s'\n", VAR_1);

    return 0;

}

static int FUNC_0(FFServerConfig *VAR_0, const char *VAR_1,
const char **VAR_2, int VAR_3)
{ int VAR_4; char VAR_5[1024]; if (!av_strcasecmp(VAR_1, "Port") || !av_strcasecmp(VAR_1, "HTTPPort")) { if (!av_strcasecmp(VAR_1, "Port"))
WARNING("Port option is deprecated, use HTTPPort instead\n"); ffserver_get_arg(VAR_5, sizeof(VAR_5), VAR_2); VAR_4 = atoi(VAR_5); if (VAR_4 < 1 || VAR_4 > 65536)
ERROR("Invalid port: %s\n", VAR_5); if (VAR_4 < 1024)
WARNING("Trying to use IETF assigned system port: %d\n", VAR_4); VAR_0->http_addr.sin_port = htons(VAR_4); } else if (!av_strcasecmp(VAR_1, "HTTPBindAddress") || !av_strcasecmp(VAR_1, "BindAddress")) { if (!av_strcasecmp(VAR_1, "BindAddress"))
WARNING("BindAddress option is deprecated, use HTTPBindAddress instead\n"); ffserver_get_arg(VAR_5, sizeof(VAR_5), VAR_2); if (resolve_host(&VAR_0->http_addr.sin_addr, VAR_5) != 0)
ERROR("%s:%d: Invalid host/IP address: %s\n", VAR_5); } else if (!av_strcasecmp(VAR_1, "NoDaemon")) { WARNING("NoDaemon option has no effect, you should remove it\n"); } else if (!av_strcasecmp(VAR_1, "RTSPPort")) { ffserver_get_arg(VAR_5, sizeof(VAR_5), VAR_2); VAR_4 = atoi(VAR_5); if (VAR_4 < 1 || VAR_4 > 65536)
ERROR("%s:%d: Invalid port: %s\n", VAR_5); VAR_0->rtsp_addr.sin_port = htons(atoi(VAR_5)); } else if (!av_strcasecmp(VAR_1, "RTSPBindAddress")) { ffserver_get_arg(VAR_5, sizeof(VAR_5), VAR_2); if (resolve_host(&VAR_0->rtsp_addr.sin_addr, VAR_5) != 0)
ERROR("Invalid host/IP address: %s\n", VAR_5); } else if (!av_strcasecmp(VAR_1, "MaxHTTPConnections")) { ffserver_get_arg(VAR_5, sizeof(VAR_5), VAR_2); VAR_4 = atoi(VAR_5); if (VAR_4 < 1 || VAR_4 > 65536)
ERROR("Invalid MaxHTTPConnections: %s\n", VAR_5); VAR_0->nb_max_http_connections = VAR_4; } else if (!av_strcasecmp(VAR_1, "MaxClients")) { ffserver_get_arg(VAR_5, sizeof(VAR_5), VAR_2); VAR_4 = atoi(VAR_5); if (VAR_4 < 1 || VAR_4 > VAR_0->nb_max_http_connections)
ERROR("Invalid MaxClients: %s\n", VAR_5); else
VAR_0->nb_max_connections = VAR_4; } else if (!av_strcasecmp(VAR_1, "MaxBandwidth")) { int64_t llval; ffserver_get_arg(VAR_5, sizeof(VAR_5), VAR_2); llval = strtoll(VAR_5, NULL, 10); if (llval < 10 || llval > 10000000)
ERROR("Invalid MaxBandwidth: %s\n", VAR_5); else
VAR_0->max_bandwidth = llval; } else if (!av_strcasecmp(VAR_1, "CustomLog")) { if (!VAR_0->debug)
ffserver_get_arg(VAR_0->logfilename, sizeof(VAR_0->logfilename), VAR_2); } else if (!av_strcasecmp(VAR_1, "LoadModule")) { ERROR("Loadable modules no longer supported\n"); } else ERROR("Incorrect keyword: '%s'\n", VAR_1); return 0; }