Commit 4e2f2c77 authored by Mikio Hara's avatar Mikio Hara

syscall: add IPv4 ancillary data for linux

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5039042
parent 33a15eb6
...@@ -117,6 +117,7 @@ typedef struct ip_mreq $IPMreq; ...@@ -117,6 +117,7 @@ typedef struct ip_mreq $IPMreq;
typedef struct ipv6_mreq $IPv6Mreq; typedef struct ipv6_mreq $IPv6Mreq;
typedef struct msghdr $Msghdr; typedef struct msghdr $Msghdr;
typedef struct cmsghdr $Cmsghdr; typedef struct cmsghdr $Cmsghdr;
typedef struct in_pktinfo $Inet4Pktinfo;
typedef struct in6_pktinfo $Inet6Pktinfo; typedef struct in6_pktinfo $Inet6Pktinfo;
typedef struct ucred $Ucred; typedef struct ucred $Ucred;
...@@ -132,6 +133,7 @@ enum { ...@@ -132,6 +133,7 @@ enum {
$SizeofIPv6Mreq = sizeof(struct ipv6_mreq), $SizeofIPv6Mreq = sizeof(struct ipv6_mreq),
$SizeofMsghdr = sizeof(struct msghdr), $SizeofMsghdr = sizeof(struct msghdr),
$SizeofCmsghdr = sizeof(struct cmsghdr), $SizeofCmsghdr = sizeof(struct cmsghdr),
$SizeofInet4Pktinfo = sizeof(struct in_pktinfo),
$SizeofInet6Pktinfo = sizeof(struct in6_pktinfo), $SizeofInet6Pktinfo = sizeof(struct in6_pktinfo),
$SizeofUcred = sizeof(struct ucred), $SizeofUcred = sizeof(struct ucred),
}; };
......
...@@ -23,6 +23,7 @@ const ( ...@@ -23,6 +23,7 @@ const (
SizeofIPv6Mreq = 0x14 SizeofIPv6Mreq = 0x14
SizeofMsghdr = 0x1c SizeofMsghdr = 0x1c
SizeofCmsghdr = 0xc SizeofCmsghdr = 0xc
SizeofInet4Pktinfo = 0xc
SizeofInet6Pktinfo = 0x14 SizeofInet6Pktinfo = 0x14
SizeofUcred = 0xc SizeofUcred = 0xc
IFA_UNSPEC = 0 IFA_UNSPEC = 0
...@@ -328,6 +329,12 @@ type Cmsghdr struct { ...@@ -328,6 +329,12 @@ type Cmsghdr struct {
Type int32 Type int32
} }
type Inet4Pktinfo struct {
Ifindex int32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type Inet6Pktinfo struct { type Inet6Pktinfo struct {
Addr [16]byte /* in6_addr */ Addr [16]byte /* in6_addr */
Ifindex uint32 Ifindex uint32
......
...@@ -23,6 +23,7 @@ const ( ...@@ -23,6 +23,7 @@ const (
SizeofIPv6Mreq = 0x14 SizeofIPv6Mreq = 0x14
SizeofMsghdr = 0x38 SizeofMsghdr = 0x38
SizeofCmsghdr = 0x10 SizeofCmsghdr = 0x10
SizeofInet4Pktinfo = 0xc
SizeofInet6Pktinfo = 0x14 SizeofInet6Pktinfo = 0x14
SizeofUcred = 0xc SizeofUcred = 0xc
IFA_UNSPEC = 0 IFA_UNSPEC = 0
...@@ -330,6 +331,12 @@ type Cmsghdr struct { ...@@ -330,6 +331,12 @@ type Cmsghdr struct {
Type int32 Type int32
} }
type Inet4Pktinfo struct {
Ifindex int32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type Inet6Pktinfo struct { type Inet6Pktinfo struct {
Addr [16]byte /* in6_addr */ Addr [16]byte /* in6_addr */
Ifindex uint32 Ifindex uint32
......
...@@ -28,6 +28,7 @@ const ( ...@@ -28,6 +28,7 @@ const (
SizeofIPv6Mreq = 0x14 SizeofIPv6Mreq = 0x14
SizeofMsghdr = 0x1c SizeofMsghdr = 0x1c
SizeofCmsghdr = 0xc SizeofCmsghdr = 0xc
SizeofInet4Pktinfo = 0xc
SizeofInet6Pktinfo = 0x14 SizeofInet6Pktinfo = 0x14
SizeofUcred = 0xc SizeofUcred = 0xc
IFA_UNSPEC = 0 IFA_UNSPEC = 0
...@@ -335,6 +336,12 @@ type Cmsghdr struct { ...@@ -335,6 +336,12 @@ type Cmsghdr struct {
Type int32 Type int32
} }
type Inet4Pktinfo struct {
Ifindex int32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type Inet6Pktinfo struct { type Inet6Pktinfo struct {
Addr [16]byte /* in6_addr */ Addr [16]byte /* in6_addr */
Ifindex uint32 Ifindex uint32
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment