...
1
2
3
4 package ipv4
5
6 const (
7 sizeofSockaddrStorage = 0x80
8 sizeofSockaddrInet = 0x10
9
10 sizeofIPMreq = 0x8
11 sizeofIPMreqSource = 0xc
12 sizeofGroupReq = 0x84
13 sizeofGroupSourceReq = 0x104
14 )
15
16 type sockaddrStorage struct {
17 Len uint8
18 Family uint8
19 X__ss_pad1 [6]int8
20 X__ss_align int64
21 X__ss_pad2 [112]int8
22 }
23
24 type sockaddrInet struct {
25 Len uint8
26 Family uint8
27 Port uint16
28 Addr [4]byte
29 Zero [8]int8
30 }
31
32 type ipMreq struct {
33 Multiaddr [4]byte
34 Interface [4]byte
35 }
36
37 type ipMreqSource struct {
38 Multiaddr [4]byte
39 Sourceaddr [4]byte
40 Interface [4]byte
41 }
42
43 type groupReq struct {
44 Interface uint32
45 Group sockaddrStorage
46 }
47
48 type groupSourceReq struct {
49 Interface uint32
50 Group sockaddrStorage
51 Source sockaddrStorage
52 }
53
View as plain text