netlink.h (1f2d9c9dd8276b1c19ef80e6d8059fe47506d4c3) | netlink.h (670dc2833d144375eac36ad74111495a825a9288) |
---|---|
1#ifndef __NET_NETLINK_H 2#define __NET_NETLINK_H 3 4#include <linux/types.h> 5#include <linux/netlink.h> 6#include <linux/jiffies.h> 7 8/* ======================================================================== --- 624 unchanged lines hidden (view full) --- 633 * @len: length of message stream 634 * @rem: initialized to len, holds bytes currently remaining in stream 635 */ 636#define nlmsg_for_each_msg(pos, head, len, rem) \ 637 for (pos = head, rem = len; \ 638 nlmsg_ok(pos, rem); \ 639 pos = nlmsg_next(pos, &(rem))) 640 | 1#ifndef __NET_NETLINK_H 2#define __NET_NETLINK_H 3 4#include <linux/types.h> 5#include <linux/netlink.h> 6#include <linux/jiffies.h> 7 8/* ======================================================================== --- 624 unchanged lines hidden (view full) --- 633 * @len: length of message stream 634 * @rem: initialized to len, holds bytes currently remaining in stream 635 */ 636#define nlmsg_for_each_msg(pos, head, len, rem) \ 637 for (pos = head, rem = len; \ 638 nlmsg_ok(pos, rem); \ 639 pos = nlmsg_next(pos, &(rem))) 640 |
641/** 642 * nl_dump_check_consistent - check if sequence is consistent and advertise if not 643 * @cb: netlink callback structure that stores the sequence number 644 * @nlh: netlink message header to write the flag to 645 * 646 * This function checks if the sequence (generation) number changed during dump 647 * and if it did, advertises it in the netlink message header. 648 * 649 * The correct way to use it is to set cb->seq to the generation counter when 650 * all locks for dumping have been acquired, and then call this function for 651 * each message that is generated. 652 * 653 * Note that due to initialisation concerns, 0 is an invalid sequence number 654 * and must not be used by code that uses this functionality. 655 */ 656static inline void 657nl_dump_check_consistent(struct netlink_callback *cb, 658 struct nlmsghdr *nlh) 659{ 660 if (cb->prev_seq && cb->seq != cb->prev_seq) 661 nlh->nlmsg_flags |= NLM_F_DUMP_INTR; 662 cb->prev_seq = cb->seq; 663} 664 |
|
641/************************************************************************** 642 * Netlink Attributes 643 **************************************************************************/ 644 645/** 646 * nla_attr_size - length of attribute not including padding 647 * @payload: length of payload 648 */ --- 428 unchanged lines hidden --- | 665/************************************************************************** 666 * Netlink Attributes 667 **************************************************************************/ 668 669/** 670 * nla_attr_size - length of attribute not including padding 671 * @payload: length of payload 672 */ --- 428 unchanged lines hidden --- |