]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: add IPv4 ancillary data for linux
authorMikio Hara <mikioh.mikioh@gmail.com>
Fri, 23 Sep 2011 14:38:52 +0000 (23:38 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Fri, 23 Sep 2011 14:38:52 +0000 (23:38 +0900)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5039042

src/pkg/syscall/types_linux.c
src/pkg/syscall/ztypes_linux_386.go
src/pkg/syscall/ztypes_linux_amd64.go
src/pkg/syscall/ztypes_linux_arm.go

index 68d64a3a3bf9db60b14e70c361fe188d21248a6a..d8ba389b5afe61a428b2119822524446d0cfeaeb 100644 (file)
@@ -117,6 +117,7 @@ typedef struct ip_mreq $IPMreq;
 typedef struct ipv6_mreq $IPv6Mreq;
 typedef struct msghdr $Msghdr;
 typedef struct cmsghdr $Cmsghdr;
+typedef struct in_pktinfo $Inet4Pktinfo;
 typedef struct in6_pktinfo $Inet6Pktinfo;
 typedef struct ucred $Ucred;
 
@@ -132,6 +133,7 @@ enum {
        $SizeofIPv6Mreq = sizeof(struct ipv6_mreq),
        $SizeofMsghdr = sizeof(struct msghdr),
        $SizeofCmsghdr = sizeof(struct cmsghdr),
+       $SizeofInet4Pktinfo = sizeof(struct in_pktinfo),
        $SizeofInet6Pktinfo = sizeof(struct in6_pktinfo),
        $SizeofUcred = sizeof(struct ucred),
 };
index 0335eb5ee24e1f933fd633069e6e12d29dd6f909..46c92b4169e2b64783ad7ee91ec10c237a07346f 100644 (file)
@@ -23,6 +23,7 @@ const (
        SizeofIPv6Mreq          = 0x14
        SizeofMsghdr            = 0x1c
        SizeofCmsghdr           = 0xc
+       SizeofInet4Pktinfo      = 0xc
        SizeofInet6Pktinfo      = 0x14
        SizeofUcred             = 0xc
        IFA_UNSPEC              = 0
@@ -328,6 +329,12 @@ type Cmsghdr struct {
        Type  int32
 }
 
+type Inet4Pktinfo struct {
+       Ifindex  int32
+       Spec_dst [4]byte /* in_addr */
+       Addr     [4]byte /* in_addr */
+}
+
 type Inet6Pktinfo struct {
        Addr    [16]byte /* in6_addr */
        Ifindex uint32
index c97b7f6fa93fbf5b30acccb0e9ce19996a8b4354..793c2b0702df39974e6c093168bed8fbd2ea1d5f 100644 (file)
@@ -23,6 +23,7 @@ const (
        SizeofIPv6Mreq          = 0x14
        SizeofMsghdr            = 0x38
        SizeofCmsghdr           = 0x10
+       SizeofInet4Pktinfo      = 0xc
        SizeofInet6Pktinfo      = 0x14
        SizeofUcred             = 0xc
        IFA_UNSPEC              = 0
@@ -330,6 +331,12 @@ type Cmsghdr struct {
        Type  int32
 }
 
+type Inet4Pktinfo struct {
+       Ifindex  int32
+       Spec_dst [4]byte /* in_addr */
+       Addr     [4]byte /* in_addr */
+}
+
 type Inet6Pktinfo struct {
        Addr    [16]byte /* in6_addr */
        Ifindex uint32
index 3d4aded9ca5e357f072aa4ed6571a468b23d7d2a..c56afbe5dcb62e41f802184631dee93c0320b95a 100644 (file)
@@ -28,6 +28,7 @@ const (
        SizeofIPv6Mreq          = 0x14
        SizeofMsghdr            = 0x1c
        SizeofCmsghdr           = 0xc
+       SizeofInet4Pktinfo      = 0xc
        SizeofInet6Pktinfo      = 0x14
        SizeofUcred             = 0xc
        IFA_UNSPEC              = 0
@@ -335,6 +336,12 @@ type Cmsghdr struct {
        Type  int32
 }
 
+type Inet4Pktinfo struct {
+       Ifindex  int32
+       Spec_dst [4]byte /* in_addr */
+       Addr     [4]byte /* in_addr */
+}
+
 type Inet6Pktinfo struct {
        Addr    [16]byte /* in6_addr */
        Ifindex uint32