/build/buildd/libnl-1.0~pre6/include/netlink/rtnetlink-kernel.h

00001 #ifndef __LINUX_RTNETLINK_H
00002 #define __LINUX_RTNETLINK_H
00003 
00004 /**
00005  * @anchor rtnlmsgtypes
00006  * @name Specialized Message Types for Routing Netlink
00007  * @ingroup rtnl
00008  * @{
00009  */
00010 
00011 enum {
00012         RTM_BASE        = 16,
00013 #define RTM_BASE        RTM_BASE
00014 
00015         RTM_NEWLINK     = 16,
00016 #define RTM_NEWLINK     RTM_NEWLINK
00017         RTM_DELLINK,
00018 #define RTM_DELLINK     RTM_DELLINK
00019         RTM_GETLINK,
00020 #define RTM_GETLINK     RTM_GETLINK
00021         RTM_SETLINK,
00022 #define RTM_SETLINK     RTM_SETLINK
00023 
00024         RTM_NEWADDR     = 20,
00025 #define RTM_NEWADDR     RTM_NEWADDR
00026         RTM_DELADDR,
00027 #define RTM_DELADDR     RTM_DELADDR
00028         RTM_GETADDR,
00029 #define RTM_GETADDR     RTM_GETADDR
00030 
00031         RTM_NEWROUTE    = 24,
00032 #define RTM_NEWROUTE    RTM_NEWROUTE
00033         RTM_DELROUTE,
00034 #define RTM_DELROUTE    RTM_DELROUTE
00035         RTM_GETROUTE,
00036 #define RTM_GETROUTE    RTM_GETROUTE
00037 
00038         RTM_NEWNEIGH    = 28,
00039 #define RTM_NEWNEIGH    RTM_NEWNEIGH
00040         RTM_DELNEIGH,
00041 #define RTM_DELNEIGH    RTM_DELNEIGH
00042         RTM_GETNEIGH,
00043 #define RTM_GETNEIGH    RTM_GETNEIGH
00044 
00045         RTM_NEWRULE     = 32,
00046 #define RTM_NEWRULE     RTM_NEWRULE
00047         RTM_DELRULE,
00048 #define RTM_DELRULE     RTM_DELRULE
00049         RTM_GETRULE,
00050 #define RTM_GETRULE     RTM_GETRULE
00051 
00052         RTM_NEWQDISC    = 36,
00053 #define RTM_NEWQDISC    RTM_NEWQDISC
00054         RTM_DELQDISC,
00055 #define RTM_DELQDISC    RTM_DELQDISC
00056         RTM_GETQDISC,
00057 #define RTM_GETQDISC    RTM_GETQDISC
00058 
00059         RTM_NEWTCLASS   = 40,
00060 #define RTM_NEWTCLASS   RTM_NEWTCLASS
00061         RTM_DELTCLASS,
00062 #define RTM_DELTCLASS   RTM_DELTCLASS
00063         RTM_GETTCLASS,
00064 #define RTM_GETTCLASS   RTM_GETTCLASS
00065 
00066         RTM_NEWTFILTER  = 44,
00067 #define RTM_NEWTFILTER  RTM_NEWTFILTER
00068         RTM_DELTFILTER,
00069 #define RTM_DELTFILTER  RTM_DELTFILTER
00070         RTM_GETTFILTER,
00071 #define RTM_GETTFILTER  RTM_GETTFILTER
00072 
00073         RTM_NEWACTION   = 48,
00074 #define RTM_NEWACTION   RTM_NEWACTION
00075         RTM_DELACTION,
00076 #define RTM_DELACTION   RTM_DELACTION
00077         RTM_GETACTION,
00078 #define RTM_GETACTION   RTM_GETACTION
00079 
00080         RTM_NEWPREFIX   = 52,
00081 #define RTM_NEWPREFIX   RTM_NEWPREFIX
00082         RTM_GETPREFIX   = 54,
00083 #define RTM_GETPREFIX   RTM_GETPREFIX
00084 
00085         RTM_GETMULTICAST = 58,
00086 #define RTM_GETMULTICAST RTM_GETMULTICAST
00087 
00088         RTM_GETANYCAST  = 62,
00089 #define RTM_GETANYCAST  RTM_GETANYCAST
00090 
00091         RTM_NEWNEIGHTBL = 64,
00092 #define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL
00093         RTM_GETNEIGHTBL = 66,
00094 #define RTM_GETNEIGHTBL RTM_GETNEIGHTBL
00095         RTM_SETNEIGHTBL,
00096 #define RTM_SETNEIGHTBL RTM_SETNEIGHTBL
00097 
00098         __RTM_MAX,
00099 };
00100 
00101 #define RTM_MAX         (((__RTM_MAX + 3) & ~3) - 1)
00102 
00103 /** @} */
00104 
00105 #define RTM_NR_MSGTYPES (RTM_MAX + 1 - RTM_BASE)
00106 #define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2)
00107 #define RTM_FAM(cmd)    (((cmd) - RTM_BASE) >> 2)
00108 
00109 
00110 struct rtmsg
00111 {
00112         unsigned char           rtm_family;
00113         unsigned char           rtm_dst_len;
00114         unsigned char           rtm_src_len;
00115         unsigned char           rtm_tos;
00116 
00117         unsigned char           rtm_table;      /* Routing table id */
00118         unsigned char           rtm_protocol;   /* Routing protocol; see below  */
00119         unsigned char           rtm_scope;      /* See below */ 
00120         unsigned char           rtm_type;       /* See below    */
00121 
00122         unsigned                rtm_flags;
00123 };
00124 
00125 /* rtm_type */
00126 
00127 enum
00128 {
00129         RTN_UNSPEC,
00130         RTN_UNICAST,            /* Gateway or direct route      */
00131         RTN_LOCAL,              /* Accept locally               */
00132         RTN_BROADCAST,          /* Accept locally as broadcast,
00133                                    send as broadcast */
00134         RTN_ANYCAST,            /* Accept locally as broadcast,
00135                                    but send as unicast */
00136         RTN_MULTICAST,          /* Multicast route              */
00137         RTN_BLACKHOLE,          /* Drop                         */
00138         RTN_UNREACHABLE,        /* Destination is unreachable   */
00139         RTN_PROHIBIT,           /* Administratively prohibited  */
00140         RTN_THROW,              /* Not in this table            */
00141         RTN_NAT,                /* Translate this address       */
00142         RTN_XRESOLVE,           /* Use external resolver        */
00143         __RTN_MAX
00144 };
00145 
00146 #define RTN_MAX (__RTN_MAX - 1)
00147 
00148 
00149 /* rtm_protocol */
00150 
00151 #define RTPROT_UNSPEC   0
00152 #define RTPROT_REDIRECT 1       /* Route installed by ICMP redirects;
00153                                    not used by current IPv4 */
00154 #define RTPROT_KERNEL   2       /* Route installed by kernel            */
00155 #define RTPROT_BOOT     3       /* Route installed during boot          */
00156 #define RTPROT_STATIC   4       /* Route installed by administrator     */
00157 
00158 /* Values of protocol >= RTPROT_STATIC are not interpreted by kernel;
00159    they are just passed from user and back as is.
00160    It will be used by hypothetical multiple routing daemons.
00161    Note that protocol values should be standardized in order to
00162    avoid conflicts.
00163  */
00164 
00165 #define RTPROT_GATED    8       /* Apparently, GateD */
00166 #define RTPROT_RA       9       /* RDISC/ND router advertisements */
00167 #define RTPROT_MRT      10      /* Merit MRT */
00168 #define RTPROT_ZEBRA    11      /* Zebra */
00169 #define RTPROT_BIRD     12      /* BIRD */
00170 #define RTPROT_DNROUTED 13      /* DECnet routing daemon */
00171 #define RTPROT_XORP     14      /* XORP */
00172 
00173 /* rtm_scope
00174 
00175    Really it is not scope, but sort of distance to the destination.
00176    NOWHERE are reserved for not existing destinations, HOST is our
00177    local addresses, LINK are destinations, located on directly attached
00178    link and UNIVERSE is everywhere in the Universe.
00179 
00180    Intermediate values are also possible f.e. interior routes
00181    could be assigned a value between UNIVERSE and LINK.
00182 */
00183 
00184 enum rt_scope_t
00185 {
00186         RT_SCOPE_UNIVERSE=0,
00187 /* User defined values  */
00188         RT_SCOPE_SITE=200,
00189         RT_SCOPE_LINK=253,
00190         RT_SCOPE_HOST=254,
00191         RT_SCOPE_NOWHERE=255
00192 };
00193 
00194 /* rtm_flags */
00195 
00196 #define RTM_F_NOTIFY            0x100   /* Notify user of route change  */
00197 #define RTM_F_CLONED            0x200   /* This route is cloned         */
00198 #define RTM_F_EQUALIZE          0x400   /* Multipath equalizer: NI      */
00199 #define RTM_F_PREFIX            0x800   /* Prefix addresses             */
00200 
00201 /* Reserved table identifiers */
00202 
00203 enum rt_class_t
00204 {
00205         RT_TABLE_UNSPEC=0,
00206 /* User defined values */
00207         RT_TABLE_DEFAULT=253,
00208         RT_TABLE_MAIN=254,
00209         RT_TABLE_LOCAL=255,
00210         __RT_TABLE_MAX
00211 };
00212 #define RT_TABLE_MAX (__RT_TABLE_MAX - 1)
00213 
00214 
00215 
00216 /* Routing message attributes */
00217 
00218 enum rtattr_type_t
00219 {
00220         RTA_UNSPEC,
00221         RTA_DST,
00222         RTA_SRC,
00223         RTA_IIF,
00224         RTA_OIF,
00225         RTA_GATEWAY,
00226         RTA_PRIORITY,
00227         RTA_PREFSRC,
00228         RTA_METRICS,
00229         RTA_MULTIPATH,
00230         RTA_PROTOINFO,
00231         RTA_FLOW,
00232         RTA_CACHEINFO,
00233         RTA_SESSION,
00234         RTA_MP_ALGO,
00235         __RTA_MAX
00236 };
00237 
00238 #define RTA_MAX (__RTA_MAX - 1)
00239 
00240 #define RTM_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
00241 #define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg))
00242 
00243 /* RTM_MULTIPATH --- array of struct rtnexthop.
00244  *
00245  * "struct rtnexthop" describes all necessary nexthop information,
00246  * i.e. parameters of path to a destination via this nexthop.
00247  *
00248  * At the moment it is impossible to set different prefsrc, mtu, window
00249  * and rtt for different paths from multipath.
00250  */
00251 
00252 struct rtnexthop
00253 {
00254         unsigned short          rtnh_len;
00255         unsigned char           rtnh_flags;
00256         unsigned char           rtnh_hops;
00257         int                     rtnh_ifindex;
00258 };
00259 
00260 /* rtnh_flags */
00261 
00262 #define RTNH_F_DEAD             1       /* Nexthop is dead (used by multipath)  */
00263 #define RTNH_F_PERVASIVE        2       /* Do recursive gateway lookup  */
00264 #define RTNH_F_ONLINK           4       /* Gateway is forced on link    */
00265 
00266 /* Macros to handle hexthops */
00267 
00268 #define RTNH_ALIGNTO    4
00269 #define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) )
00270 #define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \
00271                            ((int)(rtnh)->rtnh_len) <= (len))
00272 #define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len)))
00273 #define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len))
00274 #define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len))
00275 #define RTNH_DATA(rtnh)   ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0)))
00276 
00277 /* RTM_CACHEINFO */
00278 
00279 struct rta_cacheinfo
00280 {
00281         __u32   rta_clntref;
00282         __u32   rta_lastuse;
00283         __s32   rta_expires;
00284         __u32   rta_error;
00285         __u32   rta_used;
00286 
00287 #define RTNETLINK_HAVE_PEERINFO 1
00288         __u32   rta_id;
00289         __u32   rta_ts;
00290         __u32   rta_tsage;
00291 };
00292 
00293 /* RTM_METRICS --- array of struct rtattr with types of RTAX_* */
00294 
00295 enum
00296 {
00297         RTAX_UNSPEC,
00298 #define RTAX_UNSPEC RTAX_UNSPEC
00299         RTAX_LOCK,
00300 #define RTAX_LOCK RTAX_LOCK
00301         RTAX_MTU,
00302 #define RTAX_MTU RTAX_MTU
00303         RTAX_WINDOW,
00304 #define RTAX_WINDOW RTAX_WINDOW
00305         RTAX_RTT,
00306 #define RTAX_RTT RTAX_RTT
00307         RTAX_RTTVAR,
00308 #define RTAX_RTTVAR RTAX_RTTVAR
00309         RTAX_SSTHRESH,
00310 #define RTAX_SSTHRESH RTAX_SSTHRESH
00311         RTAX_CWND,
00312 #define RTAX_CWND RTAX_CWND
00313         RTAX_ADVMSS,
00314 #define RTAX_ADVMSS RTAX_ADVMSS
00315         RTAX_REORDERING,
00316 #define RTAX_REORDERING RTAX_REORDERING
00317         RTAX_HOPLIMIT,
00318 #define RTAX_HOPLIMIT RTAX_HOPLIMIT
00319         RTAX_INITCWND,
00320 #define RTAX_INITCWND RTAX_INITCWND
00321         RTAX_FEATURES,
00322 #define RTAX_FEATURES RTAX_FEATURES
00323         __RTAX_MAX
00324 };
00325 
00326 #define RTAX_MAX (__RTAX_MAX - 1)
00327 
00328 /**
00329  * @name Features Metric Flags
00330  * @{
00331  */
00332 
00333 #define RTAX_FEATURE_ECN        0x00000001
00334 #define RTAX_FEATURE_SACK       0x00000002
00335 #define RTAX_FEATURE_TIMESTAMP  0x00000004
00336 #define RTAX_FEATURE_ALLFRAG    0x00000008
00337 
00338 /** @} */
00339 
00340 struct rta_session
00341 {
00342         __u8    proto;
00343 
00344         union {
00345                 struct {
00346                         __u16   sport;
00347                         __u16   dport;
00348                 } ports;
00349 
00350                 struct {
00351                         __u8    type;
00352                         __u8    code;
00353                         __u16   ident;
00354                 } icmpt;
00355 
00356                 __u32           spi;
00357         } u;
00358 };
00359 
00360 
00361 /*********************************************************
00362  *              Interface address.
00363  ****/
00364 
00365 struct ifaddrmsg
00366 {
00367         unsigned char   ifa_family;
00368         unsigned char   ifa_prefixlen;  /* The prefix length            */
00369         unsigned char   ifa_flags;      /* Flags                        */
00370         unsigned char   ifa_scope;      /* See above                    */
00371         int             ifa_index;      /* Link index                   */
00372 };
00373 
00374 enum
00375 {
00376         IFA_UNSPEC,
00377         IFA_ADDRESS,
00378         IFA_LOCAL,
00379         IFA_LABEL,
00380         IFA_BROADCAST,
00381         IFA_ANYCAST,
00382         IFA_CACHEINFO,
00383         IFA_MULTICAST,
00384         __IFA_MAX
00385 };
00386 
00387 #define IFA_MAX (__IFA_MAX - 1)
00388 
00389 /**
00390  * @name Address Flags
00391  * @{
00392  */
00393 
00394 #define IFA_F_SECONDARY         0x01
00395 #define IFA_F_TEMPORARY         IFA_F_SECONDARY
00396 
00397 #define IFA_F_DEPRECATED        0x20
00398 #define IFA_F_TENTATIVE         0x40
00399 #define IFA_F_PERMANENT         0x80
00400 
00401 struct ifa_cacheinfo
00402 {
00403         __u32   ifa_prefered;
00404         __u32   ifa_valid;
00405         __u32   cstamp; /* created timestamp, hundredths of seconds */
00406         __u32   tstamp; /* updated timestamp, hundredths of seconds */
00407 };
00408 
00409 
00410 #define IFA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
00411 #define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
00412 
00413 /*
00414    Important comment:
00415    IFA_ADDRESS is prefix address, rather than local interface address.
00416    It makes no difference for normally configured broadcast interfaces,
00417    but for point-to-point IFA_ADDRESS is DESTINATION address,
00418    local address is supplied in IFA_LOCAL attribute.
00419  */
00420 
00421 /**************************************************************
00422  *              Neighbour discovery.
00423  ****/
00424 
00425 struct ndmsg
00426 {
00427         unsigned char   ndm_family;
00428         unsigned char   ndm_pad1;
00429         unsigned short  ndm_pad2;
00430         int             ndm_ifindex;    /* Link index                   */
00431         __u16           ndm_state;
00432         __u8            ndm_flags;
00433         __u8            ndm_type;
00434 };
00435 
00436 enum
00437 {
00438         NDA_UNSPEC,
00439         NDA_DST,
00440         NDA_LLADDR,
00441         NDA_CACHEINFO,
00442         NDA_PROBES,
00443         __NDA_MAX
00444 };
00445 
00446 #define NDA_MAX (__NDA_MAX - 1)
00447 
00448 #define NDA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
00449 #define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg))
00450 
00451 /*
00452  *      Neighbor Cache Entry Flags
00453  */
00454 
00455 #define NTF_PROXY       0x08    /* == ATF_PUBL */
00456 #define NTF_ROUTER      0x80
00457 
00458 /*
00459  *      Neighbor Cache Entry States.
00460  */
00461 
00462 #define NUD_INCOMPLETE  0x01
00463 #define NUD_REACHABLE   0x02
00464 #define NUD_STALE       0x04
00465 #define NUD_DELAY       0x08
00466 #define NUD_PROBE       0x10
00467 #define NUD_FAILED      0x20
00468 
00469 /* Dummy states */
00470 #define NUD_NOARP       0x40
00471 #define NUD_PERMANENT   0x80
00472 #define NUD_NONE        0x00
00473 
00474 
00475 struct nda_cacheinfo
00476 {
00477         __u32           ndm_confirmed;
00478         __u32           ndm_used;
00479         __u32           ndm_updated;
00480         __u32           ndm_refcnt;
00481 };
00482 
00483 /*****************************************************************
00484  *              Neighbour tables specific messages.
00485  *
00486  * Message Ordering:
00487  * Phase 1: foreach neighbour table
00488  *          neighbour table base configuration and statistics
00489  *          NDTA_NAME, NDTA_CONFIG, NDTA_THRESH[1-3], NDTA_STATS
00490  *          NDTA_PARMS
00491  *
00492  * Phase 2: foreach neighbour table device parameter set
00493  *          NDTA_NAME, NDTA_PARMS
00494  ****/
00495 
00496 struct ndt_stats
00497 {
00498         __u64           ndts_allocs;
00499         __u64           ndts_destroys;
00500         __u64           ndts_hash_grows;
00501         __u64           ndts_res_failed;
00502         __u64           ndts_lookups;
00503         __u64           ndts_hits;
00504         __u64           ndts_rcv_probes_mcast;
00505         __u64           ndts_rcv_probes_ucast;
00506         __u64           ndts_periodic_gc_runs;
00507         __u64           ndts_forced_gc_runs;
00508 };
00509 
00510 enum {
00511         NDTPA_UNSPEC,
00512         NDTPA_IFINDEX,                  /* u32, read-only */
00513         NDTPA_REFCNT,                   /* u32, read-only */
00514         NDTPA_REACHABLE_TIME,           /* u64, msecs, read-only */
00515         NDTPA_BASE_REACHABLE_TIME,      /* u64, msecs */
00516         NDTPA_RETRANS_TIME,             /* u64, msecs */
00517         NDTPA_GC_STALETIME,             /* u64, msecs */
00518         NDTPA_DELAY_PROBE_TIME,         /* u64, msecs */
00519         NDTPA_QUEUE_LEN,                /* u32 */
00520         NDTPA_APP_PROBES,               /* u32 */
00521         NDTPA_UCAST_PROBES,             /* u32 */
00522         NDTPA_MCAST_PROBES,             /* u32 */
00523         NDTPA_ANYCAST_DELAY,            /* u64, msecs */
00524         NDTPA_PROXY_DELAY,              /* u64, msecs */
00525         NDTPA_PROXY_QLEN,               /* u32 */
00526         NDTPA_LOCKTIME,                 /* u64, msecs */
00527         __NDTPA_MAX
00528 };
00529 #define NDTPA_MAX (__NDTPA_MAX - 1)
00530 
00531 struct ndtmsg
00532 {
00533         __u8            ndtm_family;
00534         __u8            ndtm_pad1;
00535         __u16           ndtm_pad2;
00536 };
00537 
00538 struct ndt_config
00539 {
00540         __u16           ndtc_key_len;
00541         __u16           ndtc_entry_size;
00542         __u32           ndtc_entries;
00543         __u32           ndtc_last_flush;        /* delta to now in msecs */
00544         __u32           ndtc_last_rand;         /* delta to now in msecs */
00545         __u32           ndtc_hash_rnd;
00546         __u32           ndtc_hash_mask;
00547         __u32           ndtc_hash_chain_gc;
00548         __u32           ndtc_proxy_qlen;
00549 };
00550 
00551 enum {
00552         NDTA_UNSPEC,
00553         NDTA_NAME,                      /* char * */
00554         NDTA_THRESH1,                   /* u32 */
00555         NDTA_THRESH2,                   /* u32 */
00556         NDTA_THRESH3,                   /* u32 */
00557         NDTA_CONFIG,                    /* struct ndt_config */
00558         NDTA_PARMS,                     /* NDTPA_* */
00559         NDTA_STATS,                     /* struct ndt_stats */
00560         NDTA_GC_INTERVAL,               /* u64, msecs */
00561         __NDTA_MAX
00562 };
00563 #define NDTA_MAX (__NDTA_MAX - 1)
00564 
00565 #define NDTA_RTA(r) ((struct rtattr*)(((char*)(r)) + \
00566                      NLMSG_ALIGN(sizeof(struct ndtmsg))))
00567 #define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg))
00568 
00569 /****
00570  *              General form of address family dependent message.
00571  ****/
00572 
00573 struct rtgenmsg
00574 {
00575         unsigned char           rtgen_family;
00576 };
00577 
00578 /*****************************************************************
00579  *              Link layer specific messages.
00580  ****/
00581 
00582 /* struct ifinfomsg
00583  * passes link level specific information, not dependent
00584  * on network protocol.
00585  */
00586 
00587 struct ifinfomsg
00588 {
00589         unsigned char   ifi_family;
00590         unsigned char   __ifi_pad;
00591         unsigned short  ifi_type;               /* ARPHRD_* */
00592         int             ifi_index;              /* Link index   */
00593         unsigned        ifi_flags;              /* IFF_* flags  */
00594         unsigned        ifi_change;             /* IFF_* change mask */
00595 };
00596 
00597 /********************************************************************
00598  *              prefix information 
00599  ****/
00600 
00601 struct prefixmsg
00602 {
00603         unsigned char   prefix_family;
00604         int             prefix_ifindex;
00605         unsigned char   prefix_type;
00606         unsigned char   prefix_len;
00607         unsigned char   prefix_flags;
00608 };
00609 
00610 enum 
00611 {
00612         PREFIX_UNSPEC,
00613         PREFIX_ADDRESS,
00614         PREFIX_CACHEINFO,
00615         __PREFIX_MAX
00616 };
00617 
00618 #define PREFIX_MAX      (__PREFIX_MAX - 1)
00619 
00620 struct prefix_cacheinfo
00621 {
00622         __u32   preferred_time;
00623         __u32   valid_time;
00624 };
00625 
00626 /* The struct should be in sync with struct net_device_stats */
00627 struct rtnl_link_stats
00628 {
00629         __u32   rx_packets;             /* total packets received       */
00630         __u32   tx_packets;             /* total packets transmitted    */
00631         __u32   rx_bytes;               /* total bytes received         */
00632         __u32   tx_bytes;               /* total bytes transmitted      */
00633         __u32   rx_errors;              /* bad packets received         */
00634         __u32   tx_errors;              /* packet transmit problems     */
00635         __u32   rx_dropped;             /* no space in linux buffers    */
00636         __u32   tx_dropped;             /* no space available in linux  */
00637         __u32   multicast;              /* multicast packets received   */
00638         __u32   collisions;
00639 
00640         /* detailed rx_errors: */
00641         __u32   rx_length_errors;
00642         __u32   rx_over_errors;         /* receiver ring buff overflow  */
00643         __u32   rx_crc_errors;          /* recved pkt with crc error    */
00644         __u32   rx_frame_errors;        /* recv'd frame alignment error */
00645         __u32   rx_fifo_errors;         /* recv'r fifo overrun          */
00646         __u32   rx_missed_errors;       /* receiver missed packet       */
00647 
00648         /* detailed tx_errors */
00649         __u32   tx_aborted_errors;
00650         __u32   tx_carrier_errors;
00651         __u32   tx_fifo_errors;
00652         __u32   tx_heartbeat_errors;
00653         __u32   tx_window_errors;
00654         
00655         /* for cslip etc */
00656         __u32   rx_compressed;
00657         __u32   tx_compressed;
00658 };
00659 
00660 /* The struct should be in sync with struct ifmap */
00661 struct rtnl_link_ifmap
00662 {
00663         __u64   mem_start;
00664         __u64   mem_end;
00665         __u64   base_addr;
00666         __u16   irq;
00667         __u8    dma;
00668         __u8    port;
00669 };
00670 
00671 enum
00672 {
00673         IFLA_UNSPEC,
00674         IFLA_ADDRESS,
00675         IFLA_BROADCAST,
00676         IFLA_IFNAME,
00677         IFLA_MTU,
00678         IFLA_LINK,
00679         IFLA_QDISC,
00680         IFLA_STATS,
00681         IFLA_COST,
00682 #define IFLA_COST IFLA_COST
00683         IFLA_PRIORITY,
00684 #define IFLA_PRIORITY IFLA_PRIORITY
00685         IFLA_MASTER,
00686 #define IFLA_MASTER IFLA_MASTER
00687         IFLA_WIRELESS,          /* Wireless Extension event - see wireless.h */
00688 #define IFLA_WIRELESS IFLA_WIRELESS
00689         IFLA_PROTINFO,          /* Protocol specific information for a link */
00690 #define IFLA_PROTINFO IFLA_PROTINFO
00691         IFLA_TXQLEN,
00692 #define IFLA_TXQLEN IFLA_TXQLEN
00693         IFLA_MAP,
00694 #define IFLA_MAP IFLA_MAP
00695         IFLA_WEIGHT,
00696 #define IFLA_WEIGHT IFLA_WEIGHT
00697         __IFLA_MAX
00698 };
00699 
00700 
00701 #define IFLA_MAX (__IFLA_MAX - 1)
00702 
00703 #define IFLA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
00704 #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
00705 
00706 /* ifi_flags.
00707 
00708    IFF_* flags.
00709 
00710    The only change is:
00711    IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
00712    more not changeable by user. They describe link media
00713    characteristics and set by device driver.
00714 
00715    Comments:
00716    - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
00717    - If neither of these three flags are set;
00718      the interface is NBMA.
00719 
00720    - IFF_MULTICAST does not mean anything special:
00721    multicasts can be used on all not-NBMA links.
00722    IFF_MULTICAST means that this media uses special encapsulation
00723    for multicast frames. Apparently, all IFF_POINTOPOINT and
00724    IFF_BROADCAST devices are able to use multicasts too.
00725  */
00726 
00727 /* IFLA_LINK.
00728    For usual devices it is equal ifi_index.
00729    If it is a "virtual interface" (f.e. tunnel), ifi_link
00730    can point to real physical interface (f.e. for bandwidth calculations),
00731    or maybe 0, what means, that real media is unknown (usual
00732    for IPIP tunnels, when route to endpoint is allowed to change)
00733  */
00734 
00735 /* Subtype attributes for IFLA_PROTINFO */
00736 enum
00737 {
00738         IFLA_INET6_UNSPEC,
00739         IFLA_INET6_FLAGS,       /* link flags                   */
00740         IFLA_INET6_CONF,        /* sysctl parameters            */
00741         IFLA_INET6_STATS,       /* statistics                   */
00742         IFLA_INET6_MCAST,       /* MC things. What of them?     */
00743         IFLA_INET6_CACHEINFO,   /* time values and max reasm size */
00744         __IFLA_INET6_MAX
00745 };
00746 
00747 #define IFLA_INET6_MAX  (__IFLA_INET6_MAX - 1)
00748 
00749 struct ifla_cacheinfo
00750 {
00751         __u32   max_reasm_len;
00752         __u32   tstamp;         /* ipv6InterfaceTable updated timestamp */
00753         __u32   reachable_time;
00754         __u32   retrans_time;
00755 };
00756 
00757 /*****************************************************************
00758  *              Traffic control messages.
00759  ****/
00760 
00761 struct tcmsg
00762 {
00763         unsigned char   tcm_family;
00764         unsigned char   tcm__pad1;
00765         unsigned short  tcm__pad2;
00766         int             tcm_ifindex;
00767         __u32           tcm_handle;
00768         __u32           tcm_parent;
00769         __u32           tcm_info;
00770 };
00771 
00772 enum
00773 {
00774         TCA_UNSPEC,
00775         TCA_KIND,
00776         TCA_OPTIONS,
00777         TCA_STATS,
00778         TCA_XSTATS,
00779         TCA_RATE,
00780         TCA_FCNT,
00781         TCA_STATS2,
00782         __TCA_MAX
00783 };
00784 
00785 #define TCA_MAX (__TCA_MAX - 1)
00786 
00787 #define TCA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
00788 #define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
00789 
00790 
00791 /* RTnetlink multicast groups */
00792 
00793 #define RTMGRP_LINK             1
00794 #define RTMGRP_NOTIFY           2
00795 #define RTMGRP_NEIGH            4
00796 #define RTMGRP_TC               8
00797 
00798 #define RTMGRP_IPV4_IFADDR      0x10
00799 #define RTMGRP_IPV4_MROUTE      0x20
00800 #define RTMGRP_IPV4_ROUTE       0x40
00801 
00802 #define RTMGRP_IPV6_IFADDR      0x100
00803 #define RTMGRP_IPV6_MROUTE      0x200
00804 #define RTMGRP_IPV6_ROUTE       0x400
00805 #define RTMGRP_IPV6_IFINFO      0x800
00806 
00807 #define RTMGRP_DECnet_IFADDR    0x1000
00808 #define RTMGRP_DECnet_ROUTE     0x4000
00809 
00810 #define RTMGRP_IPV6_PREFIX      0x20000
00811 
00812 /* RTnetlink multicast groups */
00813 enum rtnetlink_groups {
00814         RTNLGRP_NONE,
00815         RTNLGRP_LINK,
00816         RTNLGRP_NOTIFY,
00817         RTNLGRP_NEIGH,
00818         RTNLGRP_TC,
00819         RTNLGRP_IPV4_IFADDR,
00820         RTNLGRP_IPV4_MROUTE,
00821         RTNLGRP_IPV4_ROUTE,
00822         RTNLGRP_IPV4_RULE,
00823         RTNLGRP_IPV6_IFADDR,
00824         RTNLGRP_IPV6_MROUTE,
00825         RTNLGRP_IPV6_ROUTE,
00826         RTNLGRP_IPV6_IFINFO,
00827         RTNLGRP_DECnet_IFADDR,
00828         RTNLGRP_NOP2,
00829         RTNLGRP_DECnet_ROUTE,
00830         RTNLGRP_NOP3,
00831         RTNLGRP_NOP4,
00832         RTNLGRP_IPV6_PREFIX,
00833         RTNLGRP_FIB_MAGIC,
00834         __RTNLGRP_MAX
00835 };
00836 #define RTNLGRP_MAX     (__RTNLGRP_MAX - 1)
00837 
00838 
00839 /* TC action piece */
00840 struct tcamsg
00841 {
00842         unsigned char   tca_family;
00843         unsigned char   tca__pad1;
00844         unsigned short  tca__pad2;
00845 };
00846 #define TA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcamsg))))
00847 #define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg))
00848 #define TCA_ACT_TAB 1 /* attr type must be >=1 */       
00849 #define TCAA_MAX 1
00850 
00851 /* End of information exported to user level */
00852 
00853 #endif  /* __LINUX_RTNETLINK_H */

Generated on Fri Apr 27 14:14:07 2007 for libnl by  doxygen 1.5.1