]> bbs.cooldavid.org Git - net-next-2.6.git/commit - include/linux/rtnetlink.h
[NETLINK] Routing attribute related shortcuts
authorThomas Graf <tgraf@suug.ch>
Sun, 19 Jun 2005 05:50:38 +0000 (22:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 19 Jun 2005 05:50:38 +0000 (22:50 -0700)
commit00768244923f66801958a8d2d103f7b65608c9b6
tree8d4ec56bd4edd9e3bb47938d01ef809d60a83aa3
parentf88a10d65620d97b6d0a7e352a3493c1b7e7409b
[NETLINK] Routing attribute related shortcuts

 RTA_GET_U(32|64)(tlv)
   Assumes TLV is a u32/u64 field and returns its value.

 RTA_GET_[M]SECS(tlv)
   Assumes TLV is a u64 and transports jiffies converted
   to seconds or milliseconds and returns its value.

 RTA_PUT_U(32|64)(skb, type, value)
   Appends %value as fixed u32/u64 to %skb as TLV %type.

 RTA_PUT_[M]SECS(skb, type, jiffies)
   Converts %jiffies to secs/msecs and appends it as u64
   to %skb as TLV %type.

 RTA_PUT_STRING(skb, type, string)
   Appends %NUL terminated %string to %skb as TLV %type.

 RTA_NEST(skb, type)
   Starts a nested TLV %type and returns the nesting handle.

 RTA_NEST_END(skb, nesting_handle)
   Finishes the nested TLV %nesting_handle, must be called
   symmetric to RTA_NEST(). Returns skb->len

 RTA_NEST_CANCEL(skb, nesting_handle)
   Cancel the nested TLV %nesting_handle and trim nested TLV
   from skb again, returns -1.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/rtnetlink.h