github.com/Andyfoo/golang/x/net@v0.0.0-20190901054642-57c1bf301704/ipv4/defs_linux.go (about)

     1  // Copyright 2014 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  // +build ignore
     6  
     7  // +godefs map struct_in_addr [4]byte /* in_addr */
     8  
     9  package ipv4
    10  
    11  /*
    12  #include <time.h>
    13  
    14  #include <linux/errqueue.h>
    15  #include <linux/icmp.h>
    16  #include <linux/in.h>
    17  #include <linux/filter.h>
    18  #include <sys/socket.h>
    19  */
    20  import "C"
    21  
    22  const (
    23  	sysIP_TOS             = C.IP_TOS
    24  	sysIP_TTL             = C.IP_TTL
    25  	sysIP_HDRINCL         = C.IP_HDRINCL
    26  	sysIP_OPTIONS         = C.IP_OPTIONS
    27  	sysIP_ROUTER_ALERT    = C.IP_ROUTER_ALERT
    28  	sysIP_RECVOPTS        = C.IP_RECVOPTS
    29  	sysIP_RETOPTS         = C.IP_RETOPTS
    30  	sysIP_PKTINFO         = C.IP_PKTINFO
    31  	sysIP_PKTOPTIONS      = C.IP_PKTOPTIONS
    32  	sysIP_MTU_DISCOVER    = C.IP_MTU_DISCOVER
    33  	sysIP_RECVERR         = C.IP_RECVERR
    34  	sysIP_RECVTTL         = C.IP_RECVTTL
    35  	sysIP_RECVTOS         = C.IP_RECVTOS
    36  	sysIP_MTU             = C.IP_MTU
    37  	sysIP_FREEBIND        = C.IP_FREEBIND
    38  	sysIP_TRANSPARENT     = C.IP_TRANSPARENT
    39  	sysIP_RECVRETOPTS     = C.IP_RECVRETOPTS
    40  	sysIP_ORIGDSTADDR     = C.IP_ORIGDSTADDR
    41  	sysIP_RECVORIGDSTADDR = C.IP_RECVORIGDSTADDR
    42  	sysIP_MINTTL          = C.IP_MINTTL
    43  	sysIP_NODEFRAG        = C.IP_NODEFRAG
    44  	sysIP_UNICAST_IF      = C.IP_UNICAST_IF
    45  
    46  	sysIP_MULTICAST_IF           = C.IP_MULTICAST_IF
    47  	sysIP_MULTICAST_TTL          = C.IP_MULTICAST_TTL
    48  	sysIP_MULTICAST_LOOP         = C.IP_MULTICAST_LOOP
    49  	sysIP_ADD_MEMBERSHIP         = C.IP_ADD_MEMBERSHIP
    50  	sysIP_DROP_MEMBERSHIP        = C.IP_DROP_MEMBERSHIP
    51  	sysIP_UNBLOCK_SOURCE         = C.IP_UNBLOCK_SOURCE
    52  	sysIP_BLOCK_SOURCE           = C.IP_BLOCK_SOURCE
    53  	sysIP_ADD_SOURCE_MEMBERSHIP  = C.IP_ADD_SOURCE_MEMBERSHIP
    54  	sysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP
    55  	sysIP_MSFILTER               = C.IP_MSFILTER
    56  	sysMCAST_JOIN_GROUP          = C.MCAST_JOIN_GROUP
    57  	sysMCAST_LEAVE_GROUP         = C.MCAST_LEAVE_GROUP
    58  	sysMCAST_JOIN_SOURCE_GROUP   = C.MCAST_JOIN_SOURCE_GROUP
    59  	sysMCAST_LEAVE_SOURCE_GROUP  = C.MCAST_LEAVE_SOURCE_GROUP
    60  	sysMCAST_BLOCK_SOURCE        = C.MCAST_BLOCK_SOURCE
    61  	sysMCAST_UNBLOCK_SOURCE      = C.MCAST_UNBLOCK_SOURCE
    62  	sysMCAST_MSFILTER            = C.MCAST_MSFILTER
    63  	sysIP_MULTICAST_ALL          = C.IP_MULTICAST_ALL
    64  
    65  	//sysIP_PMTUDISC_DONT      = C.IP_PMTUDISC_DONT
    66  	//sysIP_PMTUDISC_WANT      = C.IP_PMTUDISC_WANT
    67  	//sysIP_PMTUDISC_DO        = C.IP_PMTUDISC_DO
    68  	//sysIP_PMTUDISC_PROBE     = C.IP_PMTUDISC_PROBE
    69  	//sysIP_PMTUDISC_INTERFACE = C.IP_PMTUDISC_INTERFACE
    70  	//sysIP_PMTUDISC_OMIT      = C.IP_PMTUDISC_OMIT
    71  
    72  	sysICMP_FILTER = C.ICMP_FILTER
    73  
    74  	sysSO_EE_ORIGIN_NONE         = C.SO_EE_ORIGIN_NONE
    75  	sysSO_EE_ORIGIN_LOCAL        = C.SO_EE_ORIGIN_LOCAL
    76  	sysSO_EE_ORIGIN_ICMP         = C.SO_EE_ORIGIN_ICMP
    77  	sysSO_EE_ORIGIN_ICMP6        = C.SO_EE_ORIGIN_ICMP6
    78  	sysSO_EE_ORIGIN_TXSTATUS     = C.SO_EE_ORIGIN_TXSTATUS
    79  	sysSO_EE_ORIGIN_TIMESTAMPING = C.SO_EE_ORIGIN_TIMESTAMPING
    80  
    81  	sysSOL_SOCKET       = C.SOL_SOCKET
    82  	sysSO_ATTACH_FILTER = C.SO_ATTACH_FILTER
    83  
    84  	sizeofKernelSockaddrStorage = C.sizeof_struct___kernel_sockaddr_storage
    85  	sizeofSockaddrInet          = C.sizeof_struct_sockaddr_in
    86  	sizeofInetPktinfo           = C.sizeof_struct_in_pktinfo
    87  	sizeofSockExtendedErr       = C.sizeof_struct_sock_extended_err
    88  
    89  	sizeofIPMreq         = C.sizeof_struct_ip_mreq
    90  	sizeofIPMreqn        = C.sizeof_struct_ip_mreqn
    91  	sizeofIPMreqSource   = C.sizeof_struct_ip_mreq_source
    92  	sizeofGroupReq       = C.sizeof_struct_group_req
    93  	sizeofGroupSourceReq = C.sizeof_struct_group_source_req
    94  
    95  	sizeofICMPFilter = C.sizeof_struct_icmp_filter
    96  
    97  	sizeofSockFprog = C.sizeof_struct_sock_fprog
    98  )
    99  
   100  type kernelSockaddrStorage C.struct___kernel_sockaddr_storage
   101  
   102  type sockaddrInet C.struct_sockaddr_in
   103  
   104  type inetPktinfo C.struct_in_pktinfo
   105  
   106  type sockExtendedErr C.struct_sock_extended_err
   107  
   108  type ipMreq C.struct_ip_mreq
   109  
   110  type ipMreqn C.struct_ip_mreqn
   111  
   112  type ipMreqSource C.struct_ip_mreq_source
   113  
   114  type groupReq C.struct_group_req
   115  
   116  type groupSourceReq C.struct_group_source_req
   117  
   118  type icmpFilter C.struct_icmp_filter
   119  
   120  type sockFProg C.struct_sock_fprog
   121  
   122  type sockFilter C.struct_sock_filter