Commit 9b006099 authored by Matt Layher's avatar Matt Layher Committed by Brad Fitzpatrick

unix: add tcp_md5sig on Linux

This structure is used with setsockopt in BGP speaker implementations.

For more information, please see:
https://criticalindirection.com/2015/05/12/tcp_md5sig/.

Fixes golang/go#24830

Change-Id: Ic2137e843ad502dbe9a4227362b63164789c5877
Reviewed-on: https://go-review.googlesource.com/106656Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent b126b21c
...@@ -67,6 +67,7 @@ package unix ...@@ -67,6 +67,7 @@ package unix
#include <linux/taskstats.h> #include <linux/taskstats.h>
#include <linux/cgroupstats.h> #include <linux/cgroupstats.h>
#include <linux/genetlink.h> #include <linux/genetlink.h>
#include <linux/socket.h>
// abi/abi.h generated by mkall.go. // abi/abi.h generated by mkall.go.
#include "abi/abi.h" #include "abi/abi.h"
...@@ -956,3 +957,9 @@ const ( ...@@ -956,3 +957,9 @@ const (
CBitFieldMaskBit62 = C.BITFIELD_MASK_62 CBitFieldMaskBit62 = C.BITFIELD_MASK_62
CBitFieldMaskBit63 = C.BITFIELD_MASK_63 CBitFieldMaskBit63 = C.BITFIELD_MASK_63
) )
// TCP-MD5 signature.
type SockaddrStorage C.struct_sockaddr_storage
type TCPMD5Sig C.struct_tcp_md5sig
...@@ -1133,3 +1133,18 @@ const ( ...@@ -1133,3 +1133,18 @@ const (
CBitFieldMaskBit62 = 0x4000000000000000 CBitFieldMaskBit62 = 0x4000000000000000
CBitFieldMaskBit63 = 0x8000000000000000 CBitFieldMaskBit63 = 0x8000000000000000
) )
type SockaddrStorage struct {
Family uint16
_ [122]int8
_ uint32
}
type TCPMD5Sig struct {
Addr SockaddrStorage
Flags uint8
Prefixlen uint8
Keylen uint16
_ uint32
Key [80]uint8
}
...@@ -1151,3 +1151,18 @@ const ( ...@@ -1151,3 +1151,18 @@ const (
CBitFieldMaskBit62 = 0x4000000000000000 CBitFieldMaskBit62 = 0x4000000000000000
CBitFieldMaskBit63 = 0x8000000000000000 CBitFieldMaskBit63 = 0x8000000000000000
) )
type SockaddrStorage struct {
Family uint16
_ [118]int8
_ uint64
}
type TCPMD5Sig struct {
Addr SockaddrStorage
Flags uint8
Prefixlen uint8
Keylen uint16
_ uint32
Key [80]uint8
}
...@@ -1122,3 +1122,18 @@ const ( ...@@ -1122,3 +1122,18 @@ const (
CBitFieldMaskBit62 = 0x4000000000000000 CBitFieldMaskBit62 = 0x4000000000000000
CBitFieldMaskBit63 = 0x8000000000000000 CBitFieldMaskBit63 = 0x8000000000000000
) )
type SockaddrStorage struct {
Family uint16
_ [122]uint8
_ uint32
}
type TCPMD5Sig struct {
Addr SockaddrStorage
Flags uint8
Prefixlen uint8
Keylen uint16
_ uint32
Key [80]uint8
}
...@@ -1130,3 +1130,18 @@ const ( ...@@ -1130,3 +1130,18 @@ const (
CBitFieldMaskBit62 = 0x4000000000000000 CBitFieldMaskBit62 = 0x4000000000000000
CBitFieldMaskBit63 = 0x8000000000000000 CBitFieldMaskBit63 = 0x8000000000000000
) )
type SockaddrStorage struct {
Family uint16
_ [118]int8
_ uint64
}
type TCPMD5Sig struct {
Addr SockaddrStorage
Flags uint8
Prefixlen uint8
Keylen uint16
_ uint32
Key [80]uint8
}
...@@ -1127,3 +1127,18 @@ const ( ...@@ -1127,3 +1127,18 @@ const (
CBitFieldMaskBit62 = 0x2 CBitFieldMaskBit62 = 0x2
CBitFieldMaskBit63 = 0x1 CBitFieldMaskBit63 = 0x1
) )
type SockaddrStorage struct {
Family uint16
_ [122]int8
_ uint32
}
type TCPMD5Sig struct {
Addr SockaddrStorage
Flags uint8
Prefixlen uint8
Keylen uint16
_ uint32
Key [80]uint8
}
...@@ -1132,3 +1132,18 @@ const ( ...@@ -1132,3 +1132,18 @@ const (
CBitFieldMaskBit62 = 0x2 CBitFieldMaskBit62 = 0x2
CBitFieldMaskBit63 = 0x1 CBitFieldMaskBit63 = 0x1
) )
type SockaddrStorage struct {
Family uint16
_ [118]int8
_ uint64
}
type TCPMD5Sig struct {
Addr SockaddrStorage
Flags uint8
Prefixlen uint8
Keylen uint16
_ uint32
Key [80]uint8
}
...@@ -1132,3 +1132,18 @@ const ( ...@@ -1132,3 +1132,18 @@ const (
CBitFieldMaskBit62 = 0x4000000000000000 CBitFieldMaskBit62 = 0x4000000000000000
CBitFieldMaskBit63 = 0x8000000000000000 CBitFieldMaskBit63 = 0x8000000000000000
) )
type SockaddrStorage struct {
Family uint16
_ [118]int8
_ uint64
}
type TCPMD5Sig struct {
Addr SockaddrStorage
Flags uint8
Prefixlen uint8
Keylen uint16
_ uint32
Key [80]uint8
}
...@@ -1127,3 +1127,18 @@ const ( ...@@ -1127,3 +1127,18 @@ const (
CBitFieldMaskBit62 = 0x4000000000000000 CBitFieldMaskBit62 = 0x4000000000000000
CBitFieldMaskBit63 = 0x8000000000000000 CBitFieldMaskBit63 = 0x8000000000000000
) )
type SockaddrStorage struct {
Family uint16
_ [122]int8
_ uint32
}
type TCPMD5Sig struct {
Addr SockaddrStorage
Flags uint8
Prefixlen uint8
Keylen uint16
_ uint32
Key [80]uint8
}
...@@ -1140,3 +1140,18 @@ const ( ...@@ -1140,3 +1140,18 @@ const (
CBitFieldMaskBit62 = 0x2 CBitFieldMaskBit62 = 0x2
CBitFieldMaskBit63 = 0x1 CBitFieldMaskBit63 = 0x1
) )
type SockaddrStorage struct {
Family uint16
_ [118]uint8
_ uint64
}
type TCPMD5Sig struct {
Addr SockaddrStorage
Flags uint8
Prefixlen uint8
Keylen uint16
_ uint32
Key [80]uint8
}
...@@ -1140,3 +1140,18 @@ const ( ...@@ -1140,3 +1140,18 @@ const (
CBitFieldMaskBit62 = 0x4000000000000000 CBitFieldMaskBit62 = 0x4000000000000000
CBitFieldMaskBit63 = 0x8000000000000000 CBitFieldMaskBit63 = 0x8000000000000000
) )
type SockaddrStorage struct {
Family uint16
_ [118]uint8
_ uint64
}
type TCPMD5Sig struct {
Addr SockaddrStorage
Flags uint8
Prefixlen uint8
Keylen uint16
_ uint32
Key [80]uint8
}
...@@ -1157,3 +1157,18 @@ const ( ...@@ -1157,3 +1157,18 @@ const (
CBitFieldMaskBit62 = 0x2 CBitFieldMaskBit62 = 0x2
CBitFieldMaskBit63 = 0x1 CBitFieldMaskBit63 = 0x1
) )
type SockaddrStorage struct {
Family uint16
_ [118]int8
_ uint64
}
type TCPMD5Sig struct {
Addr SockaddrStorage
Flags uint8
Prefixlen uint8
Keylen uint16
_ uint32
Key [80]uint8
}
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