mirror of https://github.com/vishvananda/netlink
Drop cgo usage for ifReq structure.
Signed-off-by: Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
This commit is contained in:
parent
11eac9d2ec
commit
2838743155
|
@ -1,17 +1,14 @@
|
||||||
package netlink
|
package netlink
|
||||||
|
|
||||||
/*
|
// ideally golang.org/x/sys/unix would define IfReq but it only has
|
||||||
#include <sys/ioctl.h>
|
// IFNAMSIZ, hence this minimalistic implementation
|
||||||
#include <sys/socket.h>
|
const (
|
||||||
#include <linux/if.h>
|
SizeOfIfReq = 40
|
||||||
#include <linux/if_tun.h>
|
IFNAMSIZ = 16
|
||||||
|
)
|
||||||
#define IFREQ_SIZE sizeof(struct ifreq)
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
|
|
||||||
type ifReq struct {
|
type ifReq struct {
|
||||||
Name [C.IFNAMSIZ]byte
|
Name [IFNAMSIZ]byte
|
||||||
Flags uint16
|
Flags uint16
|
||||||
pad [C.IFREQ_SIZE - C.IFNAMSIZ - 2]byte
|
pad [SizeOfIfReq - IFNAMSIZ - 2]byte
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue