Changeset 16260


Ignore:
Timestamp:
02/22/11 13:50:10 (2 years ago)
Author:
BrainSlayer
Message:

pppoatm connect/disconnect fix and some redesign

Location:
src/router
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/router/httpd/modules/broadcom.c

    r15745 r16260  
    11151115        {"Status_Internet", "Connect_3g", "start_3g", 1, RESTART, NULL},        // for  
    11161116        {"Status_Internet", "Disconnect_3g", "stop_3g", 2, SERVICE_RESTART, "stop_ppp"},        // for  
     1117#endif 
     1118#ifdef HAVE_PPPOATM 
     1119        {"Status_Internet", "Connect_pppoa", "start_pppoa", 1, RESTART, NULL},  // for  
     1120        {"Status_Internet", "Disconnect_pppoa", "stop_pppoa", 2, SERVICE_RESTART, "stop_ppp"},  // for  
    11171121#endif 
    11181122        {"Status_Internet", "Connect_pppoe", "start_pppoe", 1, RESTART, NULL},  // for  
  • src/router/httpd/visuals/ejs.c

    r16205 r16260  
    20822082 
    20832083        wan_link = check_wan_link(0); 
    2084  
    2085         if (nvram_match("wan_proto", "pptp")) { 
    2086                 wan_ipaddr = 
    2087                     wan_link ? nvram_safe_get("pptp_get_ip") : 
    2088                     nvram_safe_get("wan_ipaddr"); 
    2089         } else if (!strcmp(nvram_safe_get("wan_proto"), "pppoe")) { 
    2090                 wan_ipaddr = 
    2091                     wan_link ? nvram_safe_get("wan_ipaddr") : "0.0.0.0"; 
     2084        char *wan_proto = nvram_safe_get("wan_proto"); 
     2085        if (!strcmp(wan_proto, "pptp")) { 
     2086                wan_ipaddr = wan_link ? nvram_safe_get("pptp_get_ip") : nvram_safe_get("wan_ipaddr"); 
     2087        } else if (!strcmp(wan_proto, "pppoe") 
    20922088#ifdef HAVE_PPPOATM 
    2093         } else if (!strcmp(nvram_safe_get("wan_proto"), "pppoa")) { 
    2094                 wan_ipaddr = 
    2095                     wan_link ? nvram_safe_get("wan_ipaddr") : "0.0.0.0"; 
     2089        || !strcmp(wan_proto, "pppoa") 
    20962090#endif 
    20972091#ifdef HAVE_3G 
    2098         } else if (!strcmp(nvram_safe_get("wan_proto"), "3g")) { 
    2099                 wan_ipaddr = 
    2100                     wan_link ? nvram_safe_get("wan_ipaddr") : "0.0.0.0"; 
    2101 #endif 
     2092        || !strcmp(wan_proto, "3g") 
     2093#endif   
     2094        ) { 
     2095                wan_ipaddr = wan_link ? nvram_safe_get("wan_ipaddr") : "0.0.0.0"; 
    21022096#ifdef HAVE_L2TP 
    21032097        } else if (nvram_match("wan_proto", "l2tp")) { 
  • src/router/httpd/visuals/index.c

    r16189 r16260  
    1616        if (type == NULL) 
    1717                type = nvram_safe_get("wan_proto"); 
    18         if (!strcmp(type, "static")) 
    19                 do_ej(NULL, "index_static.asp", wp, NULL); 
    20 #ifdef HAVE_PPPOE 
    21         else if (!strcmp(type, "pppoe")) 
    22                 do_ej(NULL, "index_pppoe.asp", wp, NULL); 
    23 #endif 
    24 #ifdef HAVE_PPPOATM 
    25         else if (!strcmp(type, "pppoa")) 
    26                 do_ej(NULL, "index_pppoa.asp", wp, NULL); 
    27 #endif 
    28 #ifdef HAVE_PPTP 
    29         else if (!strcmp(type, "pptp")) 
    30                 do_ej(NULL, "index_pptp.asp", wp, NULL); 
    31 #endif 
    32 #ifdef HAVE_L2TP 
    33         else if (!strcmp(type, "l2tp")) 
    34                 do_ej(NULL, "index_l2tp.asp", wp, NULL); 
    35 #endif 
    36 #ifdef HAVE_HEARTBEAT 
    37         else if (!strcmp(type, "heartbeat")) 
    38                 do_ej(NULL, "index_heartbeat.asp", wp, NULL); 
    39 #endif 
    40 #ifdef HAVE_3G 
    41         else if (!strcmp(type, "3g")) 
    42                 do_ej(NULL, "index_3g.asp", wp, NULL); 
    43 #endif 
     18        char ejname[32]; 
     19        snprintf(ejname,31,"index_%s",type); 
     20        do_ej(NULL, ejname, wp, NULL); 
    4421} 
    4522 
  • src/router/httpd/visuals/setupassistant.c

    r15868 r16260  
    186186        if (type == NULL) 
    187187                type = nvram_safe_get("wan_proto"); 
    188         if (!strcmp(type, "static")) 
    189                 do_ej(NULL, "sas_static.asp", wp, NULL); 
    190 #ifdef HAVE_PPPOE 
    191         else if (!strcmp(type, "pppoe")) 
    192                 do_ej(NULL, "sas_pppoe.asp", wp, NULL); 
    193 #endif 
    194 #ifdef HAVE_PPTP 
    195         else if (!strcmp(type, "pptp")) 
    196                 do_ej(NULL, "sas_pptp.asp", wp, NULL); 
    197 #endif 
    198 #ifdef HAVE_L2TP 
    199         else if (!strcmp(type, "l2tp")) 
    200                 do_ej(NULL, "sas_l2tp.asp", wp, NULL); 
    201 #endif 
    202 #ifdef HAVE_HEARTBEAT 
    203         else if (!strcmp(type, "heartbeat")) 
    204                 do_ej(NULL, "sas_heartbeat.asp", wp, NULL); 
    205 #endif 
    206 #ifdef HAVE_3G 
    207         else if (!strcmp(type, "3g")) 
    208                 do_ej(NULL, "sas_3g.asp", wp, NULL); 
    209 #endif 
     188        char ejname[32]; 
     189        snprintf(ejname,31,"sas_%s",type); 
     190        do_ej(NULL, ejname, wp, NULL); 
    210191} 
    211192 
  • src/router/httpd/visuals/status.c

    r16191 r16260  
    115115                    wan_link ? nvram_safe_get("wan_gateway") : 
    116116                    nvram_safe_get("pptp_server_ip"); 
    117         } else if (!strcmp(wan_proto, "pppoe")) { 
     117        } else if (!strcmp(wan_proto, "pppoe") 
     118#ifdef HAVE_PPPOATM 
     119        || !strcmp(wan_proto, "pppoa") 
     120#endif 
     121#ifdef HAVE_3G 
     122        || !strcmp(wan_proto, "3g") 
     123#endif   
     124        ) { 
    118125                wan_ipaddr = 
    119126                    wan_link ? nvram_safe_get("wan_ipaddr") : "0.0.0.0"; 
     
    123130                    wan_link ? nvram_safe_get("wan_gateway") : "0.0.0.0"; 
    124131        }  
    125 #ifdef HAVE_PPPOATM 
    126         else if (!strcmp(wan_proto, "pppoa")) { 
    127                 wan_ipaddr = 
    128                     wan_link ? nvram_safe_get("wan_ipaddr") : "0.0.0.0"; 
    129                 wan_netmask = 
    130                     wan_link ? nvram_safe_get("wan_netmask") : "0.0.0.0"; 
    131                 wan_gateway = 
    132                     wan_link ? nvram_safe_get("wan_gateway") : "0.0.0.0"; 
    133         } 
    134 #endif 
    135 #ifdef HAVE_3G 
    136         else if (!strcmp(wan_proto, "3g")) { 
    137                 wan_ipaddr = 
    138                     wan_link ? nvram_safe_get("wan_ipaddr") : "0.0.0.0"; 
    139                 wan_netmask = 
    140                     wan_link ? nvram_safe_get("wan_netmask") : "0.0.0.0"; 
    141                 wan_gateway = 
    142                     wan_link ? nvram_safe_get("wan_gateway") : "0.0.0.0"; 
    143         } 
    144 #endif 
    145132#ifdef HAVE_L2TP 
    146133        else if (!strcmp(wan_proto, "l2tp")) { 
     
    164151        dns_list = get_dns_list(); 
    165152 
    166         if (!strcmp(wan_proto, "pppoe") || !strcmp(wan_proto, "pptp") 
     153        if (!strcmp(wan_proto, "pppoe")  
     154            || !strcmp(wan_proto, "pptp") 
     155#ifdef HAVE_3G 
    167156            || !strcmp(wan_proto, "3g") 
     157#endif 
     158#ifdef HAVE_PPPOATM 
    168159            || !strcmp(wan_proto, "pppoa") 
    169             || !strcmp(wan_proto, "l2tp") || !strcmp(wan_proto, "heartbeat")) { 
     160#endif 
     161#ifdef HAVE_L2TP 
     162            || !strcmp(wan_proto, "l2tp")  
     163#endif 
     164            || !strcmp(wan_proto, "heartbeat")) { 
    170165                hidden1 = ""; 
    171166                hidden2 = ""; 
     
    251246        char buf[254]; 
    252247 
    253         if (!strcmp(wan_proto, "pppoe") || !strcmp(wan_proto, "pptp") 
     248        if (!strcmp(wan_proto, "pppoe")  
     249            || !strcmp(wan_proto, "pptp") 
     250#ifdef HAVE_3G 
    254251            || !strcmp(wan_proto, "3g") 
     252#endif 
     253#ifdef HAVE_PPPOATM 
    255254            || !strcmp(wan_proto, "pppoa") 
    256             || !strcmp(wan_proto, "l2tp") || !strcmp(wan_proto, "heartbeat")) { 
     255#endif 
     256#ifdef HAVE_L2TP 
     257            || !strcmp(wan_proto, "l2tp")  
     258#endif 
     259            || !strcmp(wan_proto, "heartbeat")) { 
    257260 
    258261                /* 
  • src/router/libutils/bcmutils.c

    r16187 r16260  
    489489        if (dns_list->num_servers == 0 && (nvram_match("wan_proto", "pppoe") 
    490490                                           || nvram_match("wan_proto", "pptp") 
     491#ifdef HAVE_PPPOATM 
    491492                                           || nvram_match("wan_proto", "pppoa") 
     493#endif 
     494#ifdef HAVE_L2TP 
    492495                                           || nvram_match("wan_proto", "l2tp") 
     496#endif 
     497#ifdef HAVE_3G 
    493498                                           || nvram_match("wan_proto", "3g")) 
     499#endif 
    494500            && nvram_match("ppp_demand", "1")) 
    495501                fprintf(fp_w, "nameserver 1.1.1.1\n"); 
  • src/router/libutils/utils.c

    r16249 r16260  
    21862186 
    21872187        if ((nvram_match("wan_proto", "pptp") 
     2188#ifdef HAVE_L2TP 
    21882189             || nvram_match("wan_proto", "l2tp") 
     2190#endif 
     2191#ifdef HAVE_PPPOE 
    21892192             || nvram_match("wan_proto", "pppoe") 
     2193#endif 
     2194#ifdef HAVE_PPPOA 
    21902195             || nvram_match("wan_proto", "pppoa") 
     2196#endif 
     2197#ifdef HAVE_3G 
    21912198             || nvram_match("wan_proto", "3g") 
     2199#endif 
    21922200             || nvram_match("wan_proto", "heartbeat")) 
    21932201            && !nvram_match("3gdata", "hso")) { 
     
    22692277{ 
    22702278        char *wan_ipaddr; 
     2279        char *wan_proto = nvram_safe_get("wan_proto"); 
    22712280        int wan_link = check_wan_link(0); 
    22722281 
    2273         if (nvram_match("wan_proto", "pptp")) { 
     2282        if (!strcmp(wan_proto, "pptp")) { 
    22742283                wan_ipaddr = 
    22752284                    wan_link ? nvram_safe_get("pptp_get_ip") : 
    22762285                    nvram_safe_get("wan_ipaddr"); 
    2277         } else if (!strcmp(nvram_safe_get("wan_proto"), "pppoe")) { 
    2278                 wan_ipaddr = 
    2279                     wan_link ? nvram_safe_get("wan_ipaddr") : "0.0.0.0"; 
     2286        } else if (!strcmp(wan_proto, "pppoe")  
    22802287#ifdef HAVE_PPPOATM 
    2281         } else if (!strcmp(nvram_safe_get("wan_proto"), "pppoa")) { 
    2282                 wan_ipaddr = 
    2283                     wan_link ? nvram_safe_get("wan_ipaddr") : "0.0.0.0"; 
     2288        || !strcmp(wan_proto, "pppoa") 
    22842289#endif 
    22852290#ifdef HAVE_3G 
    2286         } else if (!strcmp(nvram_safe_get("wan_proto"), "3g")) { 
    2287                 wan_ipaddr = 
    2288                     wan_link ? nvram_safe_get("wan_ipaddr") : "0.0.0.0"; 
    2289 #endif 
     2291        || !strcmp(wan_proto, "3g") 
     2292#endif 
     2293        ) { 
     2294                wan_ipaddr = wan_link ? nvram_safe_get("wan_ipaddr") : "0.0.0.0"; 
    22902295#ifdef HAVE_L2TP 
    2291         } else if (nvram_match("wan_proto", "l2tp")) { 
    2292                 wan_ipaddr = 
    2293                     wan_link ? nvram_safe_get("l2tp_get_ip") : 
    2294                     nvram_safe_get("wan_ipaddr"); 
     2296        } else if (!strcmp(wan_proto, "l2tp")) { 
     2297                wan_ipaddr = wan_link ? nvram_safe_get("l2tp_get_ip") : nvram_safe_get("wan_ipaddr"); 
    22952298#endif 
    22962299        } else { 
     
    27392742         */ 
    27402743        if (nvram_match("wan_proto", "pptp") 
     2744#ifdef HAVE_L2TP 
    27412745            || nvram_match("wan_proto", "l2tp") 
     2746#endif 
     2747#ifdef HAVE_3G 
    27422748            || nvram_match("wan_proto", "3g") 
     2749#endif 
     2750#ifdef HAVE_PPPOATM 
    27432751            || nvram_match("wan_proto", "pppoa") 
     2752#endif 
    27442753            || nvram_match("wan_proto", "pppoe")) { 
    27452754                if (nvram_match("pppd_pppifname", "")) 
  • src/router/rc/services.c

    r15641 r16260  
    10681068        {"stop_3g", handle_spppoe}, 
    10691069#endif 
     1070#ifdef HAVE_PPPOATM 
     1071        {"start_pppoa", handle_pppoe}, 
     1072        {"stop_pppoa", handle_spppoe}, 
     1073#endif 
    10701074        {"start_pppoe", handle_pppoe}, 
     1075        {"stop_pppoe", handle_spppoe}, 
    10711076        {"start_pptp", handle_pppoe}, 
     1077        {"stop_pptp", handle_spppoe}, 
    10721078#ifdef HAVE_L2TP 
    10731079        {"start_l2tp", handle_pppoe}, 
Note: See TracChangeset for help on using the changeset viewer.