分类: LINUX
2015-01-05 11:28:19
struct nlmsghdr {
_u32 nlmsg_len;
_u32 nlmsg_type;
_u16 nlmsg_flags;
_u32 nlmsg_seq;
_u32 nlmsg_pid;
};
RTA_OK(rta, attrlen) returns true if rta points to a valid routing attribute; attrlen is the running length
of the attribute buffer. When not true then you must assume there are no more attributes in the message, even
if attrlen is non-zero.
RTA_DATA(rta) returns a pointer to the start of this attribute's data.
RTA_PAYLOAD(rta) returns the length of this attribute's data.
RTA_NEXT(rta, attrlen) gets the next attribute after rta. Calling this macro will updateattrlen. You should
use RTA_OK to check for the validity of the returned pointer.
RTA_LENGTH(len) returns the length which is required for len bytes of data plus the header.
RTA_SPACE(len) returns the amount of space which will be needed in the message with lenbytes of data.