github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/net/route/defs_dragonfly.go (about) 1 // Copyright 2016 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build ignore 6 // +build ignore 7 8 package route 9 10 /* 11 #include <sys/socket.h> 12 #include <sys/sysctl.h> 13 14 #include <net/if.h> 15 #include <net/if_dl.h> 16 #include <net/route.h> 17 18 #include <netinet/in.h> 19 20 struct ifa_msghdr_dfly4 { 21 u_short ifam_msglen; 22 u_char ifam_version; 23 u_char ifam_type; 24 int ifam_addrs; 25 int ifam_flags; 26 u_short ifam_index; 27 int ifam_metric; 28 }; 29 30 struct ifa_msghdr_dfly58 { 31 u_short ifam_msglen; 32 u_char ifam_version; 33 u_char ifam_type; 34 u_short ifam_index; 35 int ifam_flags; 36 int ifam_addrs; 37 int ifam_addrflags; 38 int ifam_metric; 39 }; 40 */ 41 import "C" 42 43 const ( 44 sysAF_UNSPEC = C.AF_UNSPEC 45 sysAF_INET = C.AF_INET 46 sysAF_ROUTE = C.AF_ROUTE 47 sysAF_LINK = C.AF_LINK 48 sysAF_INET6 = C.AF_INET6 49 50 sysSOCK_RAW = C.SOCK_RAW 51 52 sysNET_RT_DUMP = C.NET_RT_DUMP 53 sysNET_RT_FLAGS = C.NET_RT_FLAGS 54 sysNET_RT_IFLIST = C.NET_RT_IFLIST 55 sysNET_RT_MAXID = C.NET_RT_MAXID 56 ) 57 58 const ( 59 sysCTL_MAXNAME = C.CTL_MAXNAME 60 61 sysCTL_UNSPEC = C.CTL_UNSPEC 62 sysCTL_KERN = C.CTL_KERN 63 sysCTL_VM = C.CTL_VM 64 sysCTL_VFS = C.CTL_VFS 65 sysCTL_NET = C.CTL_NET 66 sysCTL_DEBUG = C.CTL_DEBUG 67 sysCTL_HW = C.CTL_HW 68 sysCTL_MACHDEP = C.CTL_MACHDEP 69 sysCTL_USER = C.CTL_USER 70 sysCTL_P1003_1B = C.CTL_P1003_1B 71 sysCTL_LWKT = C.CTL_LWKT 72 sysCTL_MAXID = C.CTL_MAXID 73 ) 74 75 const ( 76 sysRTM_VERSION = C.RTM_VERSION 77 78 sysRTM_ADD = C.RTM_ADD 79 sysRTM_DELETE = C.RTM_DELETE 80 sysRTM_CHANGE = C.RTM_CHANGE 81 sysRTM_GET = C.RTM_GET 82 sysRTM_LOSING = C.RTM_LOSING 83 sysRTM_REDIRECT = C.RTM_REDIRECT 84 sysRTM_MISS = C.RTM_MISS 85 sysRTM_LOCK = C.RTM_LOCK 86 sysRTM_RESOLVE = C.RTM_RESOLVE 87 sysRTM_NEWADDR = C.RTM_NEWADDR 88 sysRTM_DELADDR = C.RTM_DELADDR 89 sysRTM_IFINFO = C.RTM_IFINFO 90 sysRTM_NEWMADDR = C.RTM_NEWMADDR 91 sysRTM_DELMADDR = C.RTM_DELMADDR 92 sysRTM_IFANNOUNCE = C.RTM_IFANNOUNCE 93 sysRTM_IEEE80211 = C.RTM_IEEE80211 94 95 sysRTA_DST = C.RTA_DST 96 sysRTA_GATEWAY = C.RTA_GATEWAY 97 sysRTA_NETMASK = C.RTA_NETMASK 98 sysRTA_GENMASK = C.RTA_GENMASK 99 sysRTA_IFP = C.RTA_IFP 100 sysRTA_IFA = C.RTA_IFA 101 sysRTA_AUTHOR = C.RTA_AUTHOR 102 sysRTA_BRD = C.RTA_BRD 103 sysRTA_MPLS1 = C.RTA_MPLS1 104 sysRTA_MPLS2 = C.RTA_MPLS2 105 sysRTA_MPLS3 = C.RTA_MPLS3 106 107 sysRTAX_DST = C.RTAX_DST 108 sysRTAX_GATEWAY = C.RTAX_GATEWAY 109 sysRTAX_NETMASK = C.RTAX_NETMASK 110 sysRTAX_GENMASK = C.RTAX_GENMASK 111 sysRTAX_IFP = C.RTAX_IFP 112 sysRTAX_IFA = C.RTAX_IFA 113 sysRTAX_AUTHOR = C.RTAX_AUTHOR 114 sysRTAX_BRD = C.RTAX_BRD 115 sysRTAX_MPLS1 = C.RTAX_MPLS1 116 sysRTAX_MPLS2 = C.RTAX_MPLS2 117 sysRTAX_MPLS3 = C.RTAX_MPLS3 118 sysRTAX_MAX = C.RTAX_MAX 119 ) 120 121 const ( 122 sizeofIfMsghdrDragonFlyBSD4 = C.sizeof_struct_if_msghdr 123 sizeofIfaMsghdrDragonFlyBSD4 = C.sizeof_struct_ifa_msghdr_dfly4 124 sizeofIfmaMsghdrDragonFlyBSD4 = C.sizeof_struct_ifma_msghdr 125 sizeofIfAnnouncemsghdrDragonFlyBSD4 = C.sizeof_struct_if_announcemsghdr 126 127 sizeofIfaMsghdrDragonFlyBSD58 = C.sizeof_struct_ifa_msghdr_dfly58 128 129 sizeofRtMsghdrDragonFlyBSD4 = C.sizeof_struct_rt_msghdr 130 sizeofRtMetricsDragonFlyBSD4 = C.sizeof_struct_rt_metrics 131 132 sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage 133 sizeofSockaddrInet = C.sizeof_struct_sockaddr_in 134 sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 135 )