6#ifndef NETLINK_IDIAGNL_H_
7#define NETLINK_IDIAGNL_H_
9#include <netlink/netlink.h>
10#include <linux/sock_diag.h>
27#define IDIAG_TCPDIAG_GETSOCK 18
28#define IDIAG_DCCPDIAG_GETSOCK 19
29#define IDIAG_GETSOCK_MAX 24
39 IDIAG_SS_ESTABLISHED = 1,
40 IDIAG_SS_SYN_SENT = 2,
41 IDIAG_SS_SYN_RECV = 3,
42 IDIAG_SS_FIN_WAIT1 = 4,
43 IDIAG_SS_FIN_WAIT2 = 5,
44 IDIAG_SS_TIME_WAIT = 6,
46 IDIAG_SS_CLOSE_WAIT = 8,
47 IDIAG_SS_LAST_ACK = 9,
49 IDIAG_SS_CLOSING = 11,
59#define IDIAG_SS_ALL IDIAGNL_SS_ALL
69 IDIAG_ATTR_MEMINFO = 1,
71 IDIAG_ATTR_VEGASINFO = 3,
74 IDIAG_ATTR_TCLASS = 6,
75 IDIAG_ATTR_SKMEMINFO = 7,
76 IDIAG_ATTR_SHUTDOWN = 8,
82 IDIAG_ATTR_ALL = (1<<IDIAG_ATTR_MAX) - 1,
87#define IDIAG_SK_MEMINFO_RMEM_ALLOC 0
88#define IDIAG_SK_MEMINFO_RCVBUF 1
89#define IDIAG_SK_MEMINFO_WMEM_ALLOC 2
90#define IDIAG_SK_MEMINFO_SNDBUF 3
91#define IDIAG_SK_MEMINFO_FWD_ALLOC 4
92#define IDIAG_SK_MEMINFO_WMEM_QUEUED 5
93#define IDIAG_SK_MEMINFO_OPTMEM 6
94#define IDIAG_SK_MEMINFO_BACKLOG 7
95#define IDIAG_SK_MEMINFO_VARS SK_MEMINFO_VARS
98#define IDIAG_TIMER_OFF IDIAGNL_TIMER_OFF
99#define IDIAG_TIMER_ON IDIAGNL_TIMER_ON
100#define IDIAG_TIMER_KEEPALIVE IDIAGNL_TIMER_KEEPALIVE
101#define IDIAG_TIMER_TIMEWAIT IDIAGNL_TIMER_TIMEWAIT
102#define IDIAG_TIMER_PERSIST IDIAGNL_TIMER_PERSIST
103#define IDIAG_TIMER_UNKNOWN IDIAGNL_TIMER_UNKNOWN
111#define IDIAGNL_SS_ALL (((1<<12)-1))
118 IDIAGNL_TIMER_OFF = 0,
119 IDIAGNL_TIMER_ON = 1,
120 IDIAGNL_TIMER_KEEPALIVE = 2,
121 IDIAGNL_TIMER_TIMEWAIT = 3,
122 IDIAGNL_TIMER_PERSIST = 4,
123 IDIAGNL_TIMER_UNKNOWN = 5,
int idiagnl_str2timer(const char *)
Convert inet diag timer string to int.
int idiagnl_str2state(const char *)
Convert inet diag socket state string to int.
char * idiagnl_timer2str(int, char *, size_t)
Convert inet diag timer types to strings.
int idiagnl_connect(struct nl_sock *)
Create and connect idiag netlink socket.
char * idiagnl_shutdown2str(uint8_t, char *, size_t)
Convert shutdown state to string.
char * idiagnl_state2str(int, char *, size_t)
Convert inet diag socket states to strings.
int idiagnl_send_simple(struct nl_sock *, int, uint8_t, uint16_t, uint16_t)
Send trivial idiag netlink message.
char * idiagnl_exts2str(uint8_t, char *, size_t)
Convert inet diag extension flags to a string.
char * idiagnl_attrs2str(int, char *, size_t)
Convert inet diag extension type to a string.
char * idiagnl_tcpstate2str(uint8_t, char *, size_t)
Convert inetdiag tcp states to strings.
char * idiagnl_tcpopts2str(uint8_t, char *, size_t)
Convert TCP option attributes to string.