Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/networking/libiproute/rtm_map.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 15  Line 15 
15  #include "rt_names.h"  #include "rt_names.h"
16  #include "utils.h"  #include "utils.h"
17    
18  const char *rtnl_rtntype_n2a(int id, char *buf, int len)  const char* FAST_FUNC rtnl_rtntype_n2a(int id, char *buf)
19  {  {
20   switch (id) {   switch (id) {
21   case RTN_UNSPEC:   case RTN_UNSPEC:
# Line 43  const char *rtnl_rtntype_n2a(int id, cha Line 43  const char *rtnl_rtntype_n2a(int id, cha
43   case RTN_XRESOLVE:   case RTN_XRESOLVE:
44   return "xresolve";   return "xresolve";
45   default:   default:
46   snprintf(buf, len, "%d", id);   /* buf is SPRINT_BSIZE big */
47     sprintf(buf, "%d", id);
48   return buf;   return buf;
49   }   }
50  }  }
51    
52    
53  int rtnl_rtntype_a2n(int *id, char *arg)  int FAST_FUNC rtnl_rtntype_a2n(int *id, char *arg)
54  {  {
55   static const char keywords[] ALIGN1 =   static const char keywords[] ALIGN1 =
56   "local\0""nat\0""broadcast\0""brd\0""anycast\0"   "local\0""nat\0""broadcast\0""brd\0""anycast\0"
# Line 88  int rtnl_rtntype_a2n(int *id, char *arg) Line 89  int rtnl_rtntype_a2n(int *id, char *arg)
89   res = RTN_THROW;   res = RTN_THROW;
90   else {   else {
91   res = strtoul(arg, &end, 0);   res = strtoul(arg, &end, 0);
92   if (!end || end == arg || *end || res > 255)   if (end == arg || *end || res > 255)
93   return -1;   return -1;
94   }   }
95   *id = res;   *id = res;
96   return 0;   return 0;
97  }  }
98    
99  int get_rt_realms(uint32_t *realms, char *arg)  int FAST_FUNC get_rt_realms(uint32_t *realms, char *arg)
100  {  {
101   uint32_t realm = 0;   uint32_t realm = 0;
102   char *p = strchr(arg, '/');   char *p = strchr(arg, '/');

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