Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/networking/brctl.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 983 by niro, Fri Apr 24 18:33:46 2009 UTC revision 984 by niro, Sun May 30 11:32:42 2010 UTC
# Line 16  Line 16 
16  #include <linux/sockios.h>  #include <linux/sockios.h>
17  #include <net/if.h>  #include <net/if.h>
18    
19    #ifndef SIOCBRADDBR
20    # define SIOCBRADDBR BRCTL_ADD_BRIDGE
21    #endif
22    #ifndef SIOCBRDELBR
23    # define SIOCBRDELBR BRCTL_DEL_BRIDGE
24    #endif
25    #ifndef SIOCBRADDIF
26    # define SIOCBRADDIF BRCTL_ADD_IF
27    #endif
28    #ifndef SIOCBRDELIF
29    # define SIOCBRDELIF BRCTL_DEL_IF
30    #endif
31    
32    
33  /* Maximum number of ports supported per bridge interface.  */  /* Maximum number of ports supported per bridge interface.  */
34  #ifndef MAX_PORTS  #ifndef MAX_PORTS
35  #define MAX_PORTS 32  #define MAX_PORTS 32
# Line 85  int brctl_main(int argc UNUSED_PARAM, ch Line 99  int brctl_main(int argc UNUSED_PARAM, ch
99  {  {
100   static const char keywords[] ALIGN1 =   static const char keywords[] ALIGN1 =
101   "addbr\0" "delbr\0" "addif\0" "delif\0"   "addbr\0" "delbr\0" "addif\0" "delif\0"
102   USE_FEATURE_BRCTL_FANCY(   IF_FEATURE_BRCTL_FANCY(
103   "stp\0"   "stp\0"
104   "setageing\0" "setfd\0" "sethello\0" "setmaxage\0"   "setageing\0" "setfd\0" "sethello\0" "setmaxage\0"
105   "setpathcost\0" "setportprio\0" "setbridgeprio\0"   "setpathcost\0" "setportprio\0" "setbridgeprio\0"
106   )   )
107   USE_FEATURE_BRCTL_SHOW("showmacs\0" "show\0");   IF_FEATURE_BRCTL_SHOW("showmacs\0" "show\0");
108    
109   enum { ARG_addbr = 0, ARG_delbr, ARG_addif, ARG_delif   enum { ARG_addbr = 0, ARG_delbr, ARG_addif, ARG_delif
110   USE_FEATURE_BRCTL_FANCY(,   IF_FEATURE_BRCTL_FANCY(,
111     ARG_stp,     ARG_stp,
112     ARG_setageing, ARG_setfd, ARG_sethello, ARG_setmaxage,     ARG_setageing, ARG_setfd, ARG_sethello, ARG_setmaxage,
113     ARG_setpathcost, ARG_setportprio, ARG_setbridgeprio     ARG_setpathcost, ARG_setportprio, ARG_setbridgeprio
114   )   )
115   USE_FEATURE_BRCTL_SHOW(, ARG_showmacs, ARG_show)   IF_FEATURE_BRCTL_SHOW(, ARG_showmacs, ARG_show)
116   };   };
117    
118   int fd;   int fd;
# Line 137  int brctl_main(int argc UNUSED_PARAM, ch Line 151  int brctl_main(int argc UNUSED_PARAM, ch
151    
152   if (!if_indextoname(bridx[i], brname))   if (!if_indextoname(bridx[i], brname))
153   bb_perror_msg_and_die("can't get bridge name for index %d", i);   bb_perror_msg_and_die("can't get bridge name for index %d", i);
154   strncpy(ifr.ifr_name, brname, IFNAMSIZ);   strncpy_IFNAMSIZ(ifr.ifr_name, brname);
155    
156   arm_ioctl(args, BRCTL_GET_BRIDGE_INFO,   arm_ioctl(args, BRCTL_GET_BRIDGE_INFO,
157   (unsigned long) &bi, 0);   (unsigned long) &bi, 0);
# Line 191  int brctl_main(int argc UNUSED_PARAM, ch Line 205  int brctl_main(int argc UNUSED_PARAM, ch
205   if (!*argv) /* all but 'addif/delif' need at least two arguments */   if (!*argv) /* all but 'addif/delif' need at least two arguments */
206   bb_show_usage();   bb_show_usage();
207    
208   strncpy(ifr.ifr_name, br, IFNAMSIZ);   strncpy_IFNAMSIZ(ifr.ifr_name, br);
209   if (key == ARG_addif || key == ARG_delif) { /* addif or delif */   if (key == ARG_addif || key == ARG_delif) { /* addif or delif */
210   brif = *argv;   brif = *argv;
211   ifr.ifr_ifindex = if_nametoindex(brif);   ifr.ifr_ifindex = if_nametoindex(brif);

Legend:
Removed from v.983  
changed lines
  Added in v.984