gitee.com/ks-custle/core-gm@v0.0.0-20230922171213-b83bdd97b62c/net/route/defs_darwin.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  import "C"
    21  
    22  const (
    23  	sysAF_UNSPEC = C.AF_UNSPEC
    24  	sysAF_INET   = C.AF_INET
    25  	sysAF_ROUTE  = C.AF_ROUTE
    26  	sysAF_LINK   = C.AF_LINK
    27  	sysAF_INET6  = C.AF_INET6
    28  
    29  	sysSOCK_RAW = C.SOCK_RAW
    30  
    31  	sysNET_RT_DUMP    = C.NET_RT_DUMP
    32  	sysNET_RT_FLAGS   = C.NET_RT_FLAGS
    33  	sysNET_RT_IFLIST  = C.NET_RT_IFLIST
    34  	sysNET_RT_STAT    = C.NET_RT_STAT
    35  	sysNET_RT_TRASH   = C.NET_RT_TRASH
    36  	sysNET_RT_IFLIST2 = C.NET_RT_IFLIST2
    37  	sysNET_RT_DUMP2   = C.NET_RT_DUMP2
    38  	sysNET_RT_MAXID   = C.NET_RT_MAXID
    39  )
    40  
    41  const (
    42  	sysCTL_MAXNAME = C.CTL_MAXNAME
    43  
    44  	sysCTL_UNSPEC  = C.CTL_UNSPEC
    45  	sysCTL_KERN    = C.CTL_KERN
    46  	sysCTL_VM      = C.CTL_VM
    47  	sysCTL_VFS     = C.CTL_VFS
    48  	sysCTL_NET     = C.CTL_NET
    49  	sysCTL_DEBUG   = C.CTL_DEBUG
    50  	sysCTL_HW      = C.CTL_HW
    51  	sysCTL_MACHDEP = C.CTL_MACHDEP
    52  	sysCTL_USER    = C.CTL_USER
    53  	sysCTL_MAXID   = C.CTL_MAXID
    54  )
    55  
    56  const (
    57  	sysRTM_VERSION = C.RTM_VERSION
    58  
    59  	sysRTM_ADD       = C.RTM_ADD
    60  	sysRTM_DELETE    = C.RTM_DELETE
    61  	sysRTM_CHANGE    = C.RTM_CHANGE
    62  	sysRTM_GET       = C.RTM_GET
    63  	sysRTM_LOSING    = C.RTM_LOSING
    64  	sysRTM_REDIRECT  = C.RTM_REDIRECT
    65  	sysRTM_MISS      = C.RTM_MISS
    66  	sysRTM_LOCK      = C.RTM_LOCK
    67  	sysRTM_OLDADD    = C.RTM_OLDADD
    68  	sysRTM_OLDDEL    = C.RTM_OLDDEL
    69  	sysRTM_RESOLVE   = C.RTM_RESOLVE
    70  	sysRTM_NEWADDR   = C.RTM_NEWADDR
    71  	sysRTM_DELADDR   = C.RTM_DELADDR
    72  	sysRTM_IFINFO    = C.RTM_IFINFO
    73  	sysRTM_NEWMADDR  = C.RTM_NEWMADDR
    74  	sysRTM_DELMADDR  = C.RTM_DELMADDR
    75  	sysRTM_IFINFO2   = C.RTM_IFINFO2
    76  	sysRTM_NEWMADDR2 = C.RTM_NEWMADDR2
    77  	sysRTM_GET2      = C.RTM_GET2
    78  
    79  	sysRTA_DST     = C.RTA_DST
    80  	sysRTA_GATEWAY = C.RTA_GATEWAY
    81  	sysRTA_NETMASK = C.RTA_NETMASK
    82  	sysRTA_GENMASK = C.RTA_GENMASK
    83  	sysRTA_IFP     = C.RTA_IFP
    84  	sysRTA_IFA     = C.RTA_IFA
    85  	sysRTA_AUTHOR  = C.RTA_AUTHOR
    86  	sysRTA_BRD     = C.RTA_BRD
    87  
    88  	sysRTAX_DST     = C.RTAX_DST
    89  	sysRTAX_GATEWAY = C.RTAX_GATEWAY
    90  	sysRTAX_NETMASK = C.RTAX_NETMASK
    91  	sysRTAX_GENMASK = C.RTAX_GENMASK
    92  	sysRTAX_IFP     = C.RTAX_IFP
    93  	sysRTAX_IFA     = C.RTAX_IFA
    94  	sysRTAX_AUTHOR  = C.RTAX_AUTHOR
    95  	sysRTAX_BRD     = C.RTAX_BRD
    96  	sysRTAX_MAX     = C.RTAX_MAX
    97  )
    98  
    99  const (
   100  	sizeofIfMsghdrDarwin15    = C.sizeof_struct_if_msghdr
   101  	sizeofIfaMsghdrDarwin15   = C.sizeof_struct_ifa_msghdr
   102  	sizeofIfmaMsghdrDarwin15  = C.sizeof_struct_ifma_msghdr
   103  	sizeofIfMsghdr2Darwin15   = C.sizeof_struct_if_msghdr2
   104  	sizeofIfmaMsghdr2Darwin15 = C.sizeof_struct_ifma_msghdr2
   105  	sizeofIfDataDarwin15      = C.sizeof_struct_if_data
   106  	sizeofIfData64Darwin15    = C.sizeof_struct_if_data64
   107  
   108  	sizeofRtMsghdrDarwin15  = C.sizeof_struct_rt_msghdr
   109  	sizeofRtMsghdr2Darwin15 = C.sizeof_struct_rt_msghdr2
   110  	sizeofRtMetricsDarwin15 = C.sizeof_struct_rt_metrics
   111  
   112  	sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
   113  	sizeofSockaddrInet    = C.sizeof_struct_sockaddr_in
   114  	sizeofSockaddrInet6   = C.sizeof_struct_sockaddr_in6
   115  )