iproute2/misc/ss_util.h
<<
>>
Prefs
   1#ifndef __SS_UTIL_H__
   2#define __SS_UTIL_H__
   3
   4#include <linux/sock_diag.h>
   5#include <linux/inet_diag.h>
   6
   7#define MAGIC_SEQ 123456
   8
   9#define DIAG_REQUEST(_req, _r)                                              \
  10        struct {                                                            \
  11                struct nlmsghdr nlh;                                        \
  12                _r;                                                         \
  13        } _req = {                                                          \
  14                .nlh = {                                                    \
  15                        .nlmsg_type = SOCK_DIAG_BY_FAMILY,                  \
  16                        .nlmsg_flags = NLM_F_ROOT|NLM_F_MATCH|NLM_F_REQUEST,\
  17                        .nlmsg_seq = MAGIC_SEQ,                             \
  18                        .nlmsg_len = sizeof(_req),                          \
  19                },                                                          \
  20        }
  21
  22#endif /* __SS_UTIL_H__ */
  23