<div dir="ltr">Hello all,<div><br></div><div>This is the latest patch for extended socket fd decoding. A few points :-</div><div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
+<br>
+#ifdef HAVE_LINUX_SOCK_DIAG_H<br>
+# include <linux/sock_diag.h><br>
+#else<br>
+# define SOCK_DIAG_BY_FAMILY 20<br>
+ struct sock_diag_req {<br>
<div class="">+ __u8 sdiag_family;<br>
+ __u8 sdiag_protocol;<br>
+ };<br>
</div>+#endif<br></blockquote><div><br></div><div>Unless I'm mistaken this header is present on all linux systems in /usr/include even with the dev packages installed.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
+<br>
<div class="">+#define SOCKET_BUFFER_SIZE (getpagesize() < 8192L ? getpagesize() : 8192L)<br>
</div>+<br>
+#ifdef HAVE_LINUX_INET_DIAG_H<br>
+# include <linux/inet_diag.h><br>
+#else<br>
+ struct inet_diag_sockid {<br>
+ __be16 idiag_sport;<br>
+ __be16 idiag_dport;<br>
+ __be32 idiag_src[4];<br>
+ __be32 idiag_dst[4];<br>
+ __u32 idiag_if;<br>
+ __u32 idiag_cookie[2];<br>
+ #define INET_DIAG_NOCOOKIE (~0U)<br>
+ };<br>
+#endif<br>
+<br>
+/* Not all linux/inet_diag.h have v2 */<br>
+#ifndef HAVE_STRUCT_INET_DIAG_REQ_V2<br>
+ struct inet_diag_req_v2 {<br>
<div class="">+ __u8 sdiag_family;<br>
+ __u8 sdiag_protocol;<br>
+ __u8 idiag_ext;<br>
+ __u8 pad;<br>
+ __u32 idiag_states;<br>
+ struct inet_diag_sockid id;<br>
+ };<br>
</div>+#endif<br>
<div class=""><br></div></blockquote><div><br></div><div> inet_diag_req_v2 is not present on all Linux systems.</div><div><br></div><div><br></div><div>Thanks,</div><div>-- zm</div></div></div></div>