...
1
2
3
4 package ipv4
5
6 const (
7 sizeofKernelSockaddrStorage = 0x80
8 sizeofSockaddrInet = 0x10
9 sizeofInetPktinfo = 0xc
10 sizeofSockExtendedErr = 0x10
11
12 sizeofIPMreq = 0x8
13 sizeofIPMreqSource = 0xc
14 sizeofGroupReq = 0x84
15 sizeofGroupSourceReq = 0x104
16
17 sizeofICMPFilter = 0x4
18 )
19
20 type kernelSockaddrStorage struct {
21 Family uint16
22 X__data [126]int8
23 }
24
25 type sockaddrInet struct {
26 Family uint16
27 Port uint16
28 Addr [4]byte
29 X__pad [8]uint8
30 }
31
32 type inetPktinfo struct {
33 Ifindex int32
34 Spec_dst [4]byte
35 Addr [4]byte
36 }
37
38 type sockExtendedErr struct {
39 Errno uint32
40 Origin uint8
41 Type uint8
42 Code uint8
43 Pad uint8
44 Info uint32
45 Data uint32
46 }
47
48 type ipMreq struct {
49 Multiaddr [4]byte
50 Interface [4]byte
51 }
52
53 type ipMreqSource struct {
54 Multiaddr uint32
55 Interface uint32
56 Sourceaddr uint32
57 }
58
59 type groupReq struct {
60 Interface uint32
61 Group kernelSockaddrStorage
62 }
63
64 type groupSourceReq struct {
65 Interface uint32
66 Group kernelSockaddrStorage
67 Source kernelSockaddrStorage
68 }
69
70 type icmpFilter struct {
71 Data uint32
72 }
73
View as plain text