upd6
This commit is contained in:
@@ -7,4 +7,4 @@ Differences with the V standard library `net` module:
|
||||
* Provides the low-level wrappers around C API.
|
||||
* Supports any kind of sockets, socket options, address families and protocols.
|
||||
|
||||
The `netio.protocol` module provides access to the operatins system protocols database.
|
||||
The `netio.protocol` submodule provides access to the operatins system protocols database.
|
||||
|
||||
@@ -1,422 +0,0 @@
|
||||
module netio
|
||||
|
||||
/*
|
||||
This file is generated by mkconst.sh, DO NOT EDIT.
|
||||
*/
|
||||
|
||||
pub const af_appletalk = AddrFamily(C.AF_APPLETALK)
|
||||
pub const af_arp = AddrFamily(C.AF_ARP)
|
||||
pub const af_atm = AddrFamily(C.AF_ATM)
|
||||
pub const af_bluetooth = AddrFamily(C.AF_BLUETOOTH)
|
||||
pub const af_ccitt = AddrFamily(C.AF_CCITT)
|
||||
pub const af_chaos = AddrFamily(C.AF_CHAOS)
|
||||
pub const af_cnt = AddrFamily(C.AF_CNT)
|
||||
pub const af_coip = AddrFamily(C.AF_COIP)
|
||||
pub const af_datakit = AddrFamily(C.AF_DATAKIT)
|
||||
pub const af_decnet = AddrFamily(C.AF_DECnet)
|
||||
pub const af_divert = AddrFamily(C.AF_DIVERT)
|
||||
pub const af_dli = AddrFamily(C.AF_DLI)
|
||||
pub const af_e164 = AddrFamily(C.AF_E164)
|
||||
pub const af_ecma = AddrFamily(C.AF_ECMA)
|
||||
pub const af_hylink = AddrFamily(C.AF_HYLINK)
|
||||
pub const af_hyperv = AddrFamily(C.AF_HYPERV)
|
||||
pub const af_ieee80211 = AddrFamily(C.AF_IEEE80211)
|
||||
pub const af_implink = AddrFamily(C.AF_IMPLINK)
|
||||
pub const af_inet6 = AddrFamily(C.AF_INET6)
|
||||
pub const af_inet6_sdp = AddrFamily(C.AF_INET6_SDP)
|
||||
pub const af_inet = AddrFamily(C.AF_INET)
|
||||
pub const af_inet_sdp = AddrFamily(C.AF_INET_SDP)
|
||||
pub const af_ipfwlog = AddrFamily(C.AF_IPFWLOG)
|
||||
pub const af_ipx = AddrFamily(C.AF_IPX)
|
||||
pub const af_isdn = AddrFamily(C.AF_ISDN)
|
||||
pub const af_iso = AddrFamily(C.AF_ISO)
|
||||
pub const af_lat = AddrFamily(C.AF_LAT)
|
||||
pub const af_link = AddrFamily(C.AF_LINK)
|
||||
pub const af_local = AddrFamily(C.AF_LOCAL)
|
||||
pub const af_max = AddrFamily(C.AF_MAX)
|
||||
pub const af_natm = AddrFamily(C.AF_NATM)
|
||||
pub const af_netbios = AddrFamily(C.AF_NETBIOS)
|
||||
pub const af_netgraph = AddrFamily(C.AF_NETGRAPH)
|
||||
pub const af_netlink = AddrFamily(C.AF_NETLINK)
|
||||
pub const af_osi = AddrFamily(C.AF_OSI)
|
||||
pub const af_pup = AddrFamily(C.AF_PUP)
|
||||
pub const af_route = AddrFamily(C.AF_ROUTE)
|
||||
pub const af_scluster = AddrFamily(C.AF_SCLUSTER)
|
||||
pub const af_sip = AddrFamily(C.AF_SIP)
|
||||
pub const af_slow = AddrFamily(C.AF_SLOW)
|
||||
pub const af_sna = AddrFamily(C.AF_SNA)
|
||||
pub const af_unix = AddrFamily(C.AF_UNIX)
|
||||
pub const af_unspec = AddrFamily(C.AF_UNSPEC)
|
||||
pub const af_vendor00 = AddrFamily(C.AF_VENDOR00)
|
||||
pub const af_vendor01 = AddrFamily(C.AF_VENDOR01)
|
||||
pub const af_vendor03 = AddrFamily(C.AF_VENDOR03)
|
||||
pub const af_vendor04 = AddrFamily(C.AF_VENDOR04)
|
||||
pub const af_vendor05 = AddrFamily(C.AF_VENDOR05)
|
||||
pub const af_vendor06 = AddrFamily(C.AF_VENDOR06)
|
||||
pub const af_vendor07 = AddrFamily(C.AF_VENDOR07)
|
||||
pub const af_vendor08 = AddrFamily(C.AF_VENDOR08)
|
||||
pub const af_vendor09 = AddrFamily(C.AF_VENDOR09)
|
||||
pub const af_vendor10 = AddrFamily(C.AF_VENDOR10)
|
||||
pub const af_vendor11 = AddrFamily(C.AF_VENDOR11)
|
||||
pub const af_vendor12 = AddrFamily(C.AF_VENDOR12)
|
||||
pub const af_vendor13 = AddrFamily(C.AF_VENDOR13)
|
||||
pub const af_vendor14 = AddrFamily(C.AF_VENDOR14)
|
||||
pub const af_vendor15 = AddrFamily(C.AF_VENDOR15)
|
||||
pub const af_vendor16 = AddrFamily(C.AF_VENDOR16)
|
||||
pub const af_vendor17 = AddrFamily(C.AF_VENDOR17)
|
||||
pub const af_vendor18 = AddrFamily(C.AF_VENDOR18)
|
||||
pub const af_vendor19 = AddrFamily(C.AF_VENDOR19)
|
||||
pub const af_vendor20 = AddrFamily(C.AF_VENDOR20)
|
||||
pub const af_vendor21 = AddrFamily(C.AF_VENDOR21)
|
||||
pub const af_vendor22 = AddrFamily(C.AF_VENDOR22)
|
||||
pub const af_vendor23 = AddrFamily(C.AF_VENDOR23)
|
||||
pub const af_vendor24 = AddrFamily(C.AF_VENDOR24)
|
||||
pub const af_vendor25 = AddrFamily(C.AF_VENDOR25)
|
||||
pub const af_vendor26 = AddrFamily(C.AF_VENDOR26)
|
||||
pub const af_vendor27 = AddrFamily(C.AF_VENDOR27)
|
||||
pub const af_vendor28 = AddrFamily(C.AF_VENDOR28)
|
||||
pub const af_vendor29 = AddrFamily(C.AF_VENDOR29)
|
||||
pub const af_vendor30 = AddrFamily(C.AF_VENDOR30)
|
||||
pub const af_vendor31 = AddrFamily(C.AF_VENDOR31)
|
||||
pub const af_vendor32 = AddrFamily(C.AF_VENDOR32)
|
||||
pub const af_vendor33 = AddrFamily(C.AF_VENDOR33)
|
||||
pub const af_vendor34 = AddrFamily(C.AF_VENDOR34)
|
||||
pub const af_vendor35 = AddrFamily(C.AF_VENDOR35)
|
||||
pub const af_vendor36 = AddrFamily(C.AF_VENDOR36)
|
||||
pub const af_vendor37 = AddrFamily(C.AF_VENDOR37)
|
||||
pub const af_vendor38 = AddrFamily(C.AF_VENDOR38)
|
||||
pub const af_vendor39 = AddrFamily(C.AF_VENDOR39)
|
||||
pub const af_vendor40 = AddrFamily(C.AF_VENDOR40)
|
||||
pub const af_vendor41 = AddrFamily(C.AF_VENDOR41)
|
||||
pub const af_vendor42 = AddrFamily(C.AF_VENDOR42)
|
||||
pub const af_vendor43 = AddrFamily(C.AF_VENDOR43)
|
||||
pub const af_vendor44 = AddrFamily(C.AF_VENDOR44)
|
||||
pub const af_vendor45 = AddrFamily(C.AF_VENDOR45)
|
||||
pub const af_vendor46 = AddrFamily(C.AF_VENDOR46)
|
||||
pub const af_vendor47 = AddrFamily(C.AF_VENDOR47)
|
||||
pub const ai_addrconfig = AddrInfoFlag(C.AI_ADDRCONFIG)
|
||||
pub const ai_all = AddrInfoFlag(C.AI_ALL)
|
||||
pub const ai_canonname = AddrInfoFlag(C.AI_CANONNAME)
|
||||
pub const ai_default = AddrInfoFlag(C.AI_DEFAULT)
|
||||
pub const ai_mask = AddrInfoFlag(C.AI_MASK)
|
||||
pub const ai_numerichost = AddrInfoFlag(C.AI_NUMERICHOST)
|
||||
pub const ai_numericserv = AddrInfoFlag(C.AI_NUMERICSERV)
|
||||
pub const ai_passive = AddrInfoFlag(C.AI_PASSIVE)
|
||||
pub const ai_v4mapped = AddrInfoFlag(C.AI_V4MAPPED)
|
||||
pub const ai_v4mapped_cfg = AddrInfoFlag(C.AI_V4MAPPED_CFG)
|
||||
pub const ipproto_3pc = SocketLevel(C.IPPROTO_3PC)
|
||||
pub const ipproto_adfs = SocketLevel(C.IPPROTO_ADFS)
|
||||
pub const ipproto_ahip = SocketLevel(C.IPPROTO_AHIP)
|
||||
pub const ipproto_ah = SocketLevel(C.IPPROTO_AH)
|
||||
pub const ipproto_apes = SocketLevel(C.IPPROTO_APES)
|
||||
pub const ipproto_argus = SocketLevel(C.IPPROTO_ARGUS)
|
||||
pub const ipproto_ax25 = SocketLevel(C.IPPROTO_AX25)
|
||||
pub const ipproto_bha = SocketLevel(C.IPPROTO_BHA)
|
||||
pub const ipproto_blt = SocketLevel(C.IPPROTO_BLT)
|
||||
pub const ipproto_brsatmon = SocketLevel(C.IPPROTO_BRSATMON)
|
||||
pub const ipproto_carp = SocketLevel(C.IPPROTO_CARP)
|
||||
pub const ipproto_cftp = SocketLevel(C.IPPROTO_CFTP)
|
||||
pub const ipproto_chaos = SocketLevel(C.IPPROTO_CHAOS)
|
||||
pub const ipproto_cmtp = SocketLevel(C.IPPROTO_CMTP)
|
||||
pub const ipproto_cphb = SocketLevel(C.IPPROTO_CPHB)
|
||||
pub const ipproto_cpnx = SocketLevel(C.IPPROTO_CPNX)
|
||||
pub const ipproto_dccp = SocketLevel(C.IPPROTO_DCCP)
|
||||
pub const ipproto_ddp = SocketLevel(C.IPPROTO_DDP)
|
||||
pub const ipproto_dgp = SocketLevel(C.IPPROTO_DGP)
|
||||
pub const ipproto_divert = SocketLevel(C.IPPROTO_DIVERT)
|
||||
pub const ipproto_done = SocketLevel(C.IPPROTO_DONE)
|
||||
pub const ipproto_dstopts = SocketLevel(C.IPPROTO_DSTOPTS)
|
||||
pub const ipproto_egp = SocketLevel(C.IPPROTO_EGP)
|
||||
pub const ipproto_emcon = SocketLevel(C.IPPROTO_EMCON)
|
||||
pub const ipproto_encap = SocketLevel(C.IPPROTO_ENCAP)
|
||||
pub const ipproto_eon = SocketLevel(C.IPPROTO_EON)
|
||||
pub const ipproto_esp = SocketLevel(C.IPPROTO_ESP)
|
||||
pub const ipproto_etherip = SocketLevel(C.IPPROTO_ETHERIP)
|
||||
pub const ipproto_fragment = SocketLevel(C.IPPROTO_FRAGMENT)
|
||||
pub const ipproto_ggp = SocketLevel(C.IPPROTO_GGP)
|
||||
pub const ipproto_gmtp = SocketLevel(C.IPPROTO_GMTP)
|
||||
pub const ipproto_gre = SocketLevel(C.IPPROTO_GRE)
|
||||
pub const ipproto_hello = SocketLevel(C.IPPROTO_HELLO)
|
||||
pub const ipproto_hip = SocketLevel(C.IPPROTO_HIP)
|
||||
pub const ipproto_hmp = SocketLevel(C.IPPROTO_HMP)
|
||||
pub const ipproto_hopopts = SocketLevel(C.IPPROTO_HOPOPTS)
|
||||
pub const ipproto_icmpv6 = SocketLevel(C.IPPROTO_ICMPV6)
|
||||
pub const ipproto_icmp = SocketLevel(C.IPPROTO_ICMP)
|
||||
pub const ipproto_idpr = SocketLevel(C.IPPROTO_IDPR)
|
||||
pub const ipproto_idp = SocketLevel(C.IPPROTO_IDP)
|
||||
pub const ipproto_idrp = SocketLevel(C.IPPROTO_IDRP)
|
||||
pub const ipproto_igmp = SocketLevel(C.IPPROTO_IGMP)
|
||||
pub const ipproto_igp = SocketLevel(C.IPPROTO_IGP)
|
||||
pub const ipproto_igrp = SocketLevel(C.IPPROTO_IGRP)
|
||||
pub const ipproto_il = SocketLevel(C.IPPROTO_IL)
|
||||
pub const ipproto_inlsp = SocketLevel(C.IPPROTO_INLSP)
|
||||
pub const ipproto_inp = SocketLevel(C.IPPROTO_INP)
|
||||
pub const ipproto_ipcomp = SocketLevel(C.IPPROTO_IPCOMP)
|
||||
pub const ipproto_ipcv = SocketLevel(C.IPPROTO_IPCV)
|
||||
pub const ipproto_ipeip = SocketLevel(C.IPPROTO_IPEIP)
|
||||
pub const ipproto_ipip = SocketLevel(C.IPPROTO_IPIP)
|
||||
pub const ipproto_ippc = SocketLevel(C.IPPROTO_IPPC)
|
||||
pub const ipproto_ipv4 = SocketLevel(C.IPPROTO_IPV4)
|
||||
pub const ipproto_ipv6 = SocketLevel(C.IPPROTO_IPV6)
|
||||
pub const ipproto_ip = SocketLevel(C.IPPROTO_IP)
|
||||
pub const ipproto_irtp = SocketLevel(C.IPPROTO_IRTP)
|
||||
pub const ipproto_kryptolan = SocketLevel(C.IPPROTO_KRYPTOLAN)
|
||||
pub const ipproto_larp = SocketLevel(C.IPPROTO_LARP)
|
||||
pub const ipproto_leaf1 = SocketLevel(C.IPPROTO_LEAF1)
|
||||
pub const ipproto_leaf2 = SocketLevel(C.IPPROTO_LEAF2)
|
||||
pub const ipproto_max = SocketLevel(C.IPPROTO_MAX)
|
||||
pub const ipproto_meas = SocketLevel(C.IPPROTO_MEAS)
|
||||
pub const ipproto_mhrp = SocketLevel(C.IPPROTO_MHRP)
|
||||
pub const ipproto_mh = SocketLevel(C.IPPROTO_MH)
|
||||
pub const ipproto_micp = SocketLevel(C.IPPROTO_MICP)
|
||||
pub const ipproto_mobile = SocketLevel(C.IPPROTO_MOBILE)
|
||||
pub const ipproto_mpls = SocketLevel(C.IPPROTO_MPLS)
|
||||
pub const ipproto_mtp = SocketLevel(C.IPPROTO_MTP)
|
||||
pub const ipproto_mux = SocketLevel(C.IPPROTO_MUX)
|
||||
pub const ipproto_nd = SocketLevel(C.IPPROTO_ND)
|
||||
pub const ipproto_nhrp = SocketLevel(C.IPPROTO_NHRP)
|
||||
pub const ipproto_none = SocketLevel(C.IPPROTO_NONE)
|
||||
pub const ipproto_nsp = SocketLevel(C.IPPROTO_NSP)
|
||||
pub const ipproto_nvpii = SocketLevel(C.IPPROTO_NVPII)
|
||||
pub const ipproto_old_divert = SocketLevel(C.IPPROTO_OLD_DIVERT)
|
||||
pub const ipproto_ospfigp = SocketLevel(C.IPPROTO_OSPFIGP)
|
||||
pub const ipproto_pfsync = SocketLevel(C.IPPROTO_PFSYNC)
|
||||
pub const ipproto_pgm = SocketLevel(C.IPPROTO_PGM)
|
||||
pub const ipproto_pigp = SocketLevel(C.IPPROTO_PIGP)
|
||||
pub const ipproto_pim = SocketLevel(C.IPPROTO_PIM)
|
||||
pub const ipproto_prm = SocketLevel(C.IPPROTO_PRM)
|
||||
pub const ipproto_pup = SocketLevel(C.IPPROTO_PUP)
|
||||
pub const ipproto_pvp = SocketLevel(C.IPPROTO_PVP)
|
||||
pub const ipproto_raw = SocketLevel(C.IPPROTO_RAW)
|
||||
pub const ipproto_rccmon = SocketLevel(C.IPPROTO_RCCMON)
|
||||
pub const ipproto_rdp = SocketLevel(C.IPPROTO_RDP)
|
||||
pub const ipproto_reserved_253 = SocketLevel(C.IPPROTO_RESERVED_253)
|
||||
pub const ipproto_reserved_254 = SocketLevel(C.IPPROTO_RESERVED_254)
|
||||
pub const ipproto_routing = SocketLevel(C.IPPROTO_ROUTING)
|
||||
pub const ipproto_rsvp = SocketLevel(C.IPPROTO_RSVP)
|
||||
pub const ipproto_rvd = SocketLevel(C.IPPROTO_RVD)
|
||||
pub const ipproto_satexpak = SocketLevel(C.IPPROTO_SATEXPAK)
|
||||
pub const ipproto_satmon = SocketLevel(C.IPPROTO_SATMON)
|
||||
pub const ipproto_sccsp = SocketLevel(C.IPPROTO_SCCSP)
|
||||
pub const ipproto_sctp = SocketLevel(C.IPPROTO_SCTP)
|
||||
pub const ipproto_sdrp = SocketLevel(C.IPPROTO_SDRP)
|
||||
pub const ipproto_send = SocketLevel(C.IPPROTO_SEND)
|
||||
pub const ipproto_shim6 = SocketLevel(C.IPPROTO_SHIM6)
|
||||
pub const ipproto_skip = SocketLevel(C.IPPROTO_SKIP)
|
||||
pub const ipproto_spacer = SocketLevel(C.IPPROTO_SPACER)
|
||||
pub const ipproto_srpc = SocketLevel(C.IPPROTO_SRPC)
|
||||
pub const ipproto_st = SocketLevel(C.IPPROTO_ST)
|
||||
pub const ipproto_svmtp = SocketLevel(C.IPPROTO_SVMTP)
|
||||
pub const ipproto_swipe = SocketLevel(C.IPPROTO_SWIPE)
|
||||
pub const ipproto_tcf = SocketLevel(C.IPPROTO_TCF)
|
||||
pub const ipproto_tcp = SocketLevel(C.IPPROTO_TCP)
|
||||
pub const ipproto_tlsp = SocketLevel(C.IPPROTO_TLSP)
|
||||
pub const ipproto_tpxx = SocketLevel(C.IPPROTO_TPXX)
|
||||
pub const ipproto_tp = SocketLevel(C.IPPROTO_TP)
|
||||
pub const ipproto_trunk1 = SocketLevel(C.IPPROTO_TRUNK1)
|
||||
pub const ipproto_trunk2 = SocketLevel(C.IPPROTO_TRUNK2)
|
||||
pub const ipproto_ttp = SocketLevel(C.IPPROTO_TTP)
|
||||
pub const ipproto_udplite = SocketLevel(C.IPPROTO_UDPLITE)
|
||||
pub const ipproto_udp = SocketLevel(C.IPPROTO_UDP)
|
||||
pub const ipproto_vines = SocketLevel(C.IPPROTO_VINES)
|
||||
pub const ipproto_visa = SocketLevel(C.IPPROTO_VISA)
|
||||
pub const ipproto_vmtp = SocketLevel(C.IPPROTO_VMTP)
|
||||
pub const ipproto_wbexpak = SocketLevel(C.IPPROTO_WBEXPAK)
|
||||
pub const ipproto_wbmon = SocketLevel(C.IPPROTO_WBMON)
|
||||
pub const ipproto_wsn = SocketLevel(C.IPPROTO_WSN)
|
||||
pub const ipproto_xnet = SocketLevel(C.IPPROTO_XNET)
|
||||
pub const ipproto_xtp = SocketLevel(C.IPPROTO_XTP)
|
||||
pub const ipv6_autoflowlabel = SocketOption(C.IPV6_AUTOFLOWLABEL)
|
||||
pub const ipv6_bindany = SocketOption(C.IPV6_BINDANY)
|
||||
pub const ipv6_bindv6only = SocketOption(C.IPV6_BINDV6ONLY)
|
||||
pub const ipv6_checksum = SocketOption(C.IPV6_CHECKSUM)
|
||||
pub const ipv6_default_multicast_hops = SocketOption(C.IPV6_DEFAULT_MULTICAST_HOPS)
|
||||
pub const ipv6_default_multicast_loop = SocketOption(C.IPV6_DEFAULT_MULTICAST_LOOP)
|
||||
pub const ipv6_dontfrag = SocketOption(C.IPV6_DONTFRAG)
|
||||
pub const ipv6_dstopts = SocketOption(C.IPV6_DSTOPTS)
|
||||
pub const ipv6_flowid = SocketOption(C.IPV6_FLOWID)
|
||||
pub const ipv6_flowtype = SocketOption(C.IPV6_FLOWTYPE)
|
||||
pub const ipv6_fw_add = SocketOption(C.IPV6_FW_ADD)
|
||||
pub const ipv6_fw_del = SocketOption(C.IPV6_FW_DEL)
|
||||
pub const ipv6_fw_flush = SocketOption(C.IPV6_FW_FLUSH)
|
||||
pub const ipv6_fw_get = SocketOption(C.IPV6_FW_GET)
|
||||
pub const ipv6_fw_zero = SocketOption(C.IPV6_FW_ZERO)
|
||||
pub const ipv6_hoplimit = SocketOption(C.IPV6_HOPLIMIT)
|
||||
pub const ipv6_hopopts = SocketOption(C.IPV6_HOPOPTS)
|
||||
pub const ipv6_ipsec_policy = SocketOption(C.IPV6_IPSEC_POLICY)
|
||||
pub const ipv6_join_group = SocketOption(C.IPV6_JOIN_GROUP)
|
||||
pub const ipv6_leave_group = SocketOption(C.IPV6_LEAVE_GROUP)
|
||||
pub const ipv6_max_group_src_filter = SocketOption(C.IPV6_MAX_GROUP_SRC_FILTER)
|
||||
pub const ipv6_max_memberships = SocketOption(C.IPV6_MAX_MEMBERSHIPS)
|
||||
pub const ipv6_max_sock_src_filter = SocketOption(C.IPV6_MAX_SOCK_SRC_FILTER)
|
||||
pub const ipv6_msfilter = SocketOption(C.IPV6_MSFILTER)
|
||||
pub const ipv6_multicast_hops = SocketOption(C.IPV6_MULTICAST_HOPS)
|
||||
pub const ipv6_multicast_if = SocketOption(C.IPV6_MULTICAST_IF)
|
||||
pub const ipv6_multicast_loop = SocketOption(C.IPV6_MULTICAST_LOOP)
|
||||
pub const ipv6_nexthop = SocketOption(C.IPV6_NEXTHOP)
|
||||
pub const ipv6_origdstaddr = SocketOption(C.IPV6_ORIGDSTADDR)
|
||||
pub const ipv6_pathmtu = SocketOption(C.IPV6_PATHMTU)
|
||||
pub const ipv6_pktinfo = SocketOption(C.IPV6_PKTINFO)
|
||||
pub const ipv6_portrange = SocketOption(C.IPV6_PORTRANGE)
|
||||
pub const ipv6_portrange_default = SocketOption(C.IPV6_PORTRANGE_DEFAULT)
|
||||
pub const ipv6_portrange_high = SocketOption(C.IPV6_PORTRANGE_HIGH)
|
||||
pub const ipv6_portrange_low = SocketOption(C.IPV6_PORTRANGE_LOW)
|
||||
pub const ipv6_prefer_tempaddr = SocketOption(C.IPV6_PREFER_TEMPADDR)
|
||||
pub const ipv6_recvdstopts = SocketOption(C.IPV6_RECVDSTOPTS)
|
||||
pub const ipv6_recvflowid = SocketOption(C.IPV6_RECVFLOWID)
|
||||
pub const ipv6_recvhoplimit = SocketOption(C.IPV6_RECVHOPLIMIT)
|
||||
pub const ipv6_recvhopopts = SocketOption(C.IPV6_RECVHOPOPTS)
|
||||
pub const ipv6_recvorigdstaddr = SocketOption(C.IPV6_RECVORIGDSTADDR)
|
||||
pub const ipv6_recvpathmtu = SocketOption(C.IPV6_RECVPATHMTU)
|
||||
pub const ipv6_recvpktinfo = SocketOption(C.IPV6_RECVPKTINFO)
|
||||
pub const ipv6_recvrssbucketid = SocketOption(C.IPV6_RECVRSSBUCKETID)
|
||||
pub const ipv6_recvrthdr = SocketOption(C.IPV6_RECVRTHDR)
|
||||
pub const ipv6_recvtclass = SocketOption(C.IPV6_RECVTCLASS)
|
||||
pub const ipv6_rssbucketid = SocketOption(C.IPV6_RSSBUCKETID)
|
||||
pub const ipv6_rthdrdstopts = SocketOption(C.IPV6_RTHDRDSTOPTS)
|
||||
pub const ipv6_rthdr = SocketOption(C.IPV6_RTHDR)
|
||||
pub const ipv6_rthdr_loose = SocketOption(C.IPV6_RTHDR_LOOSE)
|
||||
pub const ipv6_rthdr_strict = SocketOption(C.IPV6_RTHDR_STRICT)
|
||||
pub const ipv6_rthdr_type_0 = SocketOption(C.IPV6_RTHDR_TYPE_0)
|
||||
pub const ipv6_sockopt_reserved1 = SocketOption(C.IPV6_SOCKOPT_RESERVED1)
|
||||
pub const ipv6_tclass = SocketOption(C.IPV6_TCLASS)
|
||||
pub const ipv6_unicast_hops = SocketOption(C.IPV6_UNICAST_HOPS)
|
||||
pub const ipv6_use_min_mtu = SocketOption(C.IPV6_USE_MIN_MTU)
|
||||
pub const ipv6_v6only = SocketOption(C.IPV6_V6ONLY)
|
||||
pub const ipv6_vlan_pcp = SocketOption(C.IPV6_VLAN_PCP)
|
||||
pub const ip_add_membership = SocketOption(C.IP_ADD_MEMBERSHIP)
|
||||
pub const ip_add_source_membership = SocketOption(C.IP_ADD_SOURCE_MEMBERSHIP)
|
||||
pub const ip_bindany = SocketOption(C.IP_BINDANY)
|
||||
pub const ip_block_source = SocketOption(C.IP_BLOCK_SOURCE)
|
||||
pub const ip_default_multicast_loop = SocketOption(C.IP_DEFAULT_MULTICAST_LOOP)
|
||||
pub const ip_default_multicast_ttl = SocketOption(C.IP_DEFAULT_MULTICAST_TTL)
|
||||
pub const ip_dontfrag = SocketOption(C.IP_DONTFRAG)
|
||||
pub const ip_drop_membership = SocketOption(C.IP_DROP_MEMBERSHIP)
|
||||
pub const ip_drop_source_membership = SocketOption(C.IP_DROP_SOURCE_MEMBERSHIP)
|
||||
pub const ip_dummynet3 = SocketOption(C.IP_DUMMYNET3)
|
||||
pub const ip_dummynet_configure = SocketOption(C.IP_DUMMYNET_CONFIGURE)
|
||||
pub const ip_dummynet_del = SocketOption(C.IP_DUMMYNET_DEL)
|
||||
pub const ip_dummynet_flush = SocketOption(C.IP_DUMMYNET_FLUSH)
|
||||
pub const ip_dummynet_get = SocketOption(C.IP_DUMMYNET_GET)
|
||||
pub const ip_flowid = SocketOption(C.IP_FLOWID)
|
||||
pub const ip_flowtype = SocketOption(C.IP_FLOWTYPE)
|
||||
pub const ip_fw3 = SocketOption(C.IP_FW3)
|
||||
pub const ip_fw_add = SocketOption(C.IP_FW_ADD)
|
||||
pub const ip_fw_del = SocketOption(C.IP_FW_DEL)
|
||||
pub const ip_fw_flush = SocketOption(C.IP_FW_FLUSH)
|
||||
pub const ip_fw_get = SocketOption(C.IP_FW_GET)
|
||||
pub const ip_fw_nat_cfg = SocketOption(C.IP_FW_NAT_CFG)
|
||||
pub const ip_fw_nat_del = SocketOption(C.IP_FW_NAT_DEL)
|
||||
pub const ip_fw_nat_get_config = SocketOption(C.IP_FW_NAT_GET_CONFIG)
|
||||
pub const ip_fw_nat_get_log = SocketOption(C.IP_FW_NAT_GET_LOG)
|
||||
pub const ip_fw_resetlog = SocketOption(C.IP_FW_RESETLOG)
|
||||
pub const ip_fw_table_add = SocketOption(C.IP_FW_TABLE_ADD)
|
||||
pub const ip_fw_table_del = SocketOption(C.IP_FW_TABLE_DEL)
|
||||
pub const ip_fw_table_flush = SocketOption(C.IP_FW_TABLE_FLUSH)
|
||||
pub const ip_fw_table_getsize = SocketOption(C.IP_FW_TABLE_GETSIZE)
|
||||
pub const ip_fw_table_list = SocketOption(C.IP_FW_TABLE_LIST)
|
||||
pub const ip_fw_zero = SocketOption(C.IP_FW_ZERO)
|
||||
pub const ip_hdrincl = SocketOption(C.IP_HDRINCL)
|
||||
pub const ip_ipsec_policy = SocketOption(C.IP_IPSEC_POLICY)
|
||||
pub const ip_max_group_src_filter = SocketOption(C.IP_MAX_GROUP_SRC_FILTER)
|
||||
pub const ip_max_memberships = SocketOption(C.IP_MAX_MEMBERSHIPS)
|
||||
pub const ip_max_sock_mute_filter = SocketOption(C.IP_MAX_SOCK_MUTE_FILTER)
|
||||
pub const ip_max_sock_src_filter = SocketOption(C.IP_MAX_SOCK_SRC_FILTER)
|
||||
pub const ip_minttl = SocketOption(C.IP_MINTTL)
|
||||
pub const ip_msfilter = SocketOption(C.IP_MSFILTER)
|
||||
pub const ip_multicast_if = SocketOption(C.IP_MULTICAST_IF)
|
||||
pub const ip_multicast_loop = SocketOption(C.IP_MULTICAST_LOOP)
|
||||
pub const ip_multicast_ttl = SocketOption(C.IP_MULTICAST_TTL)
|
||||
pub const ip_multicast_vif = SocketOption(C.IP_MULTICAST_VIF)
|
||||
pub const ip_onesbcast = SocketOption(C.IP_ONESBCAST)
|
||||
pub const ip_options = SocketOption(C.IP_OPTIONS)
|
||||
pub const ip_origdstaddr = SocketOption(C.IP_ORIGDSTADDR)
|
||||
pub const ip_portrange = SocketOption(C.IP_PORTRANGE)
|
||||
pub const ip_portrange_default = SocketOption(C.IP_PORTRANGE_DEFAULT)
|
||||
pub const ip_portrange_high = SocketOption(C.IP_PORTRANGE_HIGH)
|
||||
pub const ip_portrange_low = SocketOption(C.IP_PORTRANGE_LOW)
|
||||
pub const ip_recvdstaddr = SocketOption(C.IP_RECVDSTADDR)
|
||||
pub const ip_recvflowid = SocketOption(C.IP_RECVFLOWID)
|
||||
pub const ip_recvif = SocketOption(C.IP_RECVIF)
|
||||
pub const ip_recvopts = SocketOption(C.IP_RECVOPTS)
|
||||
pub const ip_recvorigdstaddr = SocketOption(C.IP_RECVORIGDSTADDR)
|
||||
pub const ip_recvretopts = SocketOption(C.IP_RECVRETOPTS)
|
||||
pub const ip_recvrssbucketid = SocketOption(C.IP_RECVRSSBUCKETID)
|
||||
pub const ip_recvtos = SocketOption(C.IP_RECVTOS)
|
||||
pub const ip_recvttl = SocketOption(C.IP_RECVTTL)
|
||||
pub const ip_retopts = SocketOption(C.IP_RETOPTS)
|
||||
pub const ip_rssbucketid = SocketOption(C.IP_RSSBUCKETID)
|
||||
pub const ip_rsvp_off = SocketOption(C.IP_RSVP_OFF)
|
||||
pub const ip_rsvp_on = SocketOption(C.IP_RSVP_ON)
|
||||
pub const ip_rsvp_vif_off = SocketOption(C.IP_RSVP_VIF_OFF)
|
||||
pub const ip_rsvp_vif_on = SocketOption(C.IP_RSVP_VIF_ON)
|
||||
pub const ip_sendsrcaddr = SocketOption(C.IP_SENDSRCADDR)
|
||||
pub const ip_tos = SocketOption(C.IP_TOS)
|
||||
pub const ip_ttl = SocketOption(C.IP_TTL)
|
||||
pub const ip_unblock_source = SocketOption(C.IP_UNBLOCK_SOURCE)
|
||||
pub const ip_vlan_pcp = SocketOption(C.IP_VLAN_PCP)
|
||||
pub const ni_dgram = NameInfoFlag(C.NI_DGRAM)
|
||||
pub const ni_maxhost = NameInfoFlag(C.NI_MAXHOST)
|
||||
pub const ni_maxserv = NameInfoFlag(C.NI_MAXSERV)
|
||||
pub const ni_namereqd = NameInfoFlag(C.NI_NAMEREQD)
|
||||
pub const ni_nofqdn = NameInfoFlag(C.NI_NOFQDN)
|
||||
pub const ni_numerichost = NameInfoFlag(C.NI_NUMERICHOST)
|
||||
pub const ni_numericscope = NameInfoFlag(C.NI_NUMERICSCOPE)
|
||||
pub const ni_numericserv = NameInfoFlag(C.NI_NUMERICSERV)
|
||||
pub const sock_cloexec = SocketType(C.SOCK_CLOEXEC)
|
||||
pub const sock_clofork = SocketType(C.SOCK_CLOFORK)
|
||||
pub const sock_dgram = SocketType(C.SOCK_DGRAM)
|
||||
pub const sock_maxaddrlen = SocketType(C.SOCK_MAXADDRLEN)
|
||||
pub const sock_nonblock = SocketType(C.SOCK_NONBLOCK)
|
||||
pub const sock_raw = SocketType(C.SOCK_RAW)
|
||||
pub const sock_rdm = SocketType(C.SOCK_RDM)
|
||||
pub const sock_seqpacket = SocketType(C.SOCK_SEQPACKET)
|
||||
pub const sock_stream = SocketType(C.SOCK_STREAM)
|
||||
pub const sol_socket = SocketLevel(C.SOL_SOCKET)
|
||||
pub const so_acceptconn = SocketOption(C.SO_ACCEPTCONN)
|
||||
pub const so_acceptfilter = SocketOption(C.SO_ACCEPTFILTER)
|
||||
pub const so_bintime = SocketOption(C.SO_BINTIME)
|
||||
pub const so_broadcast = SocketOption(C.SO_BROADCAST)
|
||||
pub const so_debug = SocketOption(C.SO_DEBUG)
|
||||
pub const so_domain = SocketOption(C.SO_DOMAIN)
|
||||
pub const so_dontroute = SocketOption(C.SO_DONTROUTE)
|
||||
pub const so_error = SocketOption(C.SO_ERROR)
|
||||
pub const so_fib = SocketOption(C.SO_FIB)
|
||||
pub const so_keepalive = SocketOption(C.SO_KEEPALIVE)
|
||||
pub const so_label = SocketOption(C.SO_LABEL)
|
||||
pub const so_linger = SocketOption(C.SO_LINGER)
|
||||
pub const so_listenincqlen = SocketOption(C.SO_LISTENINCQLEN)
|
||||
pub const so_listenqlen = SocketOption(C.SO_LISTENQLEN)
|
||||
pub const so_listenqlimit = SocketOption(C.SO_LISTENQLIMIT)
|
||||
pub const so_max_pacing_rate = SocketOption(C.SO_MAX_PACING_RATE)
|
||||
pub const so_nosigpipe = SocketOption(C.SO_NOSIGPIPE)
|
||||
pub const so_no_ddp = SocketOption(C.SO_NO_DDP)
|
||||
pub const so_no_offload = SocketOption(C.SO_NO_OFFLOAD)
|
||||
pub const so_oobinline = SocketOption(C.SO_OOBINLINE)
|
||||
pub const so_peerlabel = SocketOption(C.SO_PEERLABEL)
|
||||
pub const so_protocol = SocketOption(C.SO_PROTOCOL)
|
||||
pub const so_prototype = SocketOption(C.SO_PROTOTYPE)
|
||||
pub const so_rcvbuf = SocketOption(C.SO_RCVBUF)
|
||||
pub const so_rcvlowat = SocketOption(C.SO_RCVLOWAT)
|
||||
pub const so_rcvtimeo = SocketOption(C.SO_RCVTIMEO)
|
||||
pub const so_rerror = SocketOption(C.SO_RERROR)
|
||||
pub const so_reuseaddr = SocketOption(C.SO_REUSEADDR)
|
||||
pub const so_reuseport = SocketOption(C.SO_REUSEPORT)
|
||||
pub const so_reuseport_lb = SocketOption(C.SO_REUSEPORT_LB)
|
||||
pub const so_setfib = SocketOption(C.SO_SETFIB)
|
||||
pub const so_sndbuf = SocketOption(C.SO_SNDBUF)
|
||||
pub const so_sndlowat = SocketOption(C.SO_SNDLOWAT)
|
||||
pub const so_sndtimeo = SocketOption(C.SO_SNDTIMEO)
|
||||
pub const so_splice = SocketOption(C.SO_SPLICE)
|
||||
pub const so_timestamp = SocketOption(C.SO_TIMESTAMP)
|
||||
pub const so_ts_bintime = SocketOption(C.SO_TS_BINTIME)
|
||||
pub const so_ts_clock = SocketOption(C.SO_TS_CLOCK)
|
||||
pub const so_ts_clock_max = SocketOption(C.SO_TS_CLOCK_MAX)
|
||||
pub const so_ts_default = SocketOption(C.SO_TS_DEFAULT)
|
||||
pub const so_ts_monotonic = SocketOption(C.SO_TS_MONOTONIC)
|
||||
pub const so_ts_realtime = SocketOption(C.SO_TS_REALTIME)
|
||||
pub const so_ts_realtime_micro = SocketOption(C.SO_TS_REALTIME_MICRO)
|
||||
pub const so_type = SocketOption(C.SO_TYPE)
|
||||
pub const so_useloopback = SocketOption(C.SO_USELOOPBACK)
|
||||
pub const so_user_cookie = SocketOption(C.SO_USER_COOKIE)
|
||||
pub const so_vendor = SocketOption(C.SO_VENDOR)
|
||||
+437
@@ -0,0 +1,437 @@
|
||||
module netio
|
||||
|
||||
/*
|
||||
This file is generated by make.vsh, DO NOT EDIT.
|
||||
*/
|
||||
|
||||
pub const af_appletalk = AddrFamily(16)
|
||||
pub const af_arp = AddrFamily(35)
|
||||
pub const af_atm = AddrFamily(30)
|
||||
pub const af_bluetooth = AddrFamily(36)
|
||||
pub const af_ccitt = AddrFamily(10)
|
||||
pub const af_chaos = AddrFamily(5)
|
||||
pub const af_cnt = AddrFamily(21)
|
||||
pub const af_coip = AddrFamily(20)
|
||||
pub const af_datakit = AddrFamily(9)
|
||||
pub const af_decnet = AddrFamily(12)
|
||||
pub const af_divert = AddrFamily(44)
|
||||
pub const af_dli = AddrFamily(13)
|
||||
pub const af_e164 = AddrFamily(26)
|
||||
pub const af_ecma = AddrFamily(8)
|
||||
pub const af_hylink = AddrFamily(15)
|
||||
pub const af_hyperv = AddrFamily(43)
|
||||
pub const af_ieee80211 = AddrFamily(37)
|
||||
pub const af_implink = AddrFamily(3)
|
||||
pub const af_inet6 = AddrFamily(28)
|
||||
pub const af_inet6_sdp = AddrFamily(42)
|
||||
pub const af_inet = AddrFamily(2)
|
||||
pub const af_inet_sdp = AddrFamily(40)
|
||||
pub const af_ipfwlog = AddrFamily(46)
|
||||
pub const af_ipx = AddrFamily(23)
|
||||
pub const af_isdn = AddrFamily(26)
|
||||
pub const af_iso = AddrFamily(7)
|
||||
pub const af_lat = AddrFamily(14)
|
||||
pub const af_link = AddrFamily(18)
|
||||
pub const af_local = AddrFamily(1)
|
||||
pub const af_max = AddrFamily(46)
|
||||
pub const af_natm = AddrFamily(29)
|
||||
pub const af_netbios = AddrFamily(6)
|
||||
pub const af_netgraph = AddrFamily(32)
|
||||
pub const af_netlink = AddrFamily(38)
|
||||
pub const af_osi = AddrFamily(7)
|
||||
pub const af_pup = AddrFamily(4)
|
||||
pub const af_route = AddrFamily(17)
|
||||
pub const af_scluster = AddrFamily(34)
|
||||
pub const af_sip = AddrFamily(24)
|
||||
pub const af_slow = AddrFamily(33)
|
||||
pub const af_sna = AddrFamily(11)
|
||||
pub const af_unix = AddrFamily(1)
|
||||
pub const af_unspec = AddrFamily(0)
|
||||
pub const af_vendor00 = AddrFamily(39)
|
||||
pub const af_vendor01 = AddrFamily(41)
|
||||
pub const af_vendor03 = AddrFamily(45)
|
||||
pub const af_vendor04 = AddrFamily(47)
|
||||
pub const af_vendor05 = AddrFamily(49)
|
||||
pub const af_vendor06 = AddrFamily(51)
|
||||
pub const af_vendor07 = AddrFamily(53)
|
||||
pub const af_vendor08 = AddrFamily(55)
|
||||
pub const af_vendor09 = AddrFamily(57)
|
||||
pub const af_vendor10 = AddrFamily(59)
|
||||
pub const af_vendor11 = AddrFamily(61)
|
||||
pub const af_vendor12 = AddrFamily(63)
|
||||
pub const af_vendor13 = AddrFamily(65)
|
||||
pub const af_vendor14 = AddrFamily(67)
|
||||
pub const af_vendor15 = AddrFamily(69)
|
||||
pub const af_vendor16 = AddrFamily(71)
|
||||
pub const af_vendor17 = AddrFamily(73)
|
||||
pub const af_vendor18 = AddrFamily(75)
|
||||
pub const af_vendor19 = AddrFamily(77)
|
||||
pub const af_vendor20 = AddrFamily(79)
|
||||
pub const af_vendor21 = AddrFamily(81)
|
||||
pub const af_vendor22 = AddrFamily(83)
|
||||
pub const af_vendor23 = AddrFamily(85)
|
||||
pub const af_vendor24 = AddrFamily(87)
|
||||
pub const af_vendor25 = AddrFamily(89)
|
||||
pub const af_vendor26 = AddrFamily(91)
|
||||
pub const af_vendor27 = AddrFamily(93)
|
||||
pub const af_vendor28 = AddrFamily(95)
|
||||
pub const af_vendor29 = AddrFamily(97)
|
||||
pub const af_vendor30 = AddrFamily(99)
|
||||
pub const af_vendor31 = AddrFamily(101)
|
||||
pub const af_vendor32 = AddrFamily(103)
|
||||
pub const af_vendor33 = AddrFamily(105)
|
||||
pub const af_vendor34 = AddrFamily(107)
|
||||
pub const af_vendor35 = AddrFamily(109)
|
||||
pub const af_vendor36 = AddrFamily(111)
|
||||
pub const af_vendor37 = AddrFamily(113)
|
||||
pub const af_vendor38 = AddrFamily(115)
|
||||
pub const af_vendor39 = AddrFamily(117)
|
||||
pub const af_vendor40 = AddrFamily(119)
|
||||
pub const af_vendor41 = AddrFamily(121)
|
||||
pub const af_vendor42 = AddrFamily(123)
|
||||
pub const af_vendor43 = AddrFamily(125)
|
||||
pub const af_vendor44 = AddrFamily(127)
|
||||
pub const af_vendor45 = AddrFamily(129)
|
||||
pub const af_vendor46 = AddrFamily(131)
|
||||
pub const af_vendor47 = AddrFamily(133)
|
||||
pub const ai_addrconfig = AddrInfoFlag(1024)
|
||||
pub const ai_all = AddrInfoFlag(256)
|
||||
pub const ai_canonname = AddrInfoFlag(2)
|
||||
pub const ai_default = AddrInfoFlag(1536)
|
||||
pub const ai_mask = AddrInfoFlag(3343)
|
||||
pub const ai_numerichost = AddrInfoFlag(4)
|
||||
pub const ai_numericserv = AddrInfoFlag(8)
|
||||
pub const ai_passive = AddrInfoFlag(1)
|
||||
pub const ai_v4mapped = AddrInfoFlag(2048)
|
||||
pub const ai_v4mapped_cfg = AddrInfoFlag(512)
|
||||
pub const ipproto_3pc = SocketLevel(34)
|
||||
pub const ipproto_adfs = SocketLevel(68)
|
||||
pub const ipproto_ahip = SocketLevel(61)
|
||||
pub const ipproto_ah = SocketLevel(51)
|
||||
pub const ipproto_apes = SocketLevel(99)
|
||||
pub const ipproto_argus = SocketLevel(13)
|
||||
pub const ipproto_ax25 = SocketLevel(93)
|
||||
pub const ipproto_bha = SocketLevel(49)
|
||||
pub const ipproto_blt = SocketLevel(30)
|
||||
pub const ipproto_brsatmon = SocketLevel(76)
|
||||
pub const ipproto_carp = SocketLevel(112)
|
||||
pub const ipproto_cftp = SocketLevel(62)
|
||||
pub const ipproto_chaos = SocketLevel(16)
|
||||
pub const ipproto_cmtp = SocketLevel(38)
|
||||
pub const ipproto_cphb = SocketLevel(73)
|
||||
pub const ipproto_cpnx = SocketLevel(72)
|
||||
pub const ipproto_dccp = SocketLevel(33)
|
||||
pub const ipproto_ddp = SocketLevel(37)
|
||||
pub const ipproto_dgp = SocketLevel(86)
|
||||
pub const ipproto_divert = SocketLevel(258)
|
||||
pub const ipproto_done = SocketLevel(257)
|
||||
pub const ipproto_dstopts = SocketLevel(60)
|
||||
pub const ipproto_egp = SocketLevel(8)
|
||||
pub const ipproto_emcon = SocketLevel(14)
|
||||
pub const ipproto_encap = SocketLevel(98)
|
||||
pub const ipproto_eon = SocketLevel(80)
|
||||
pub const ipproto_esp = SocketLevel(50)
|
||||
pub const ipproto_etherip = SocketLevel(97)
|
||||
pub const ipproto_fragment = SocketLevel(44)
|
||||
pub const ipproto_ggp = SocketLevel(3)
|
||||
pub const ipproto_gmtp = SocketLevel(100)
|
||||
pub const ipproto_gre = SocketLevel(47)
|
||||
pub const ipproto_hello = SocketLevel(63)
|
||||
pub const ipproto_hip = SocketLevel(139)
|
||||
pub const ipproto_hmp = SocketLevel(20)
|
||||
pub const ipproto_hopopts = SocketLevel(0)
|
||||
pub const ipproto_icmpv6 = SocketLevel(58)
|
||||
pub const ipproto_icmp = SocketLevel(1)
|
||||
pub const ipproto_idpr = SocketLevel(35)
|
||||
pub const ipproto_idp = SocketLevel(22)
|
||||
pub const ipproto_idrp = SocketLevel(45)
|
||||
pub const ipproto_igmp = SocketLevel(2)
|
||||
pub const ipproto_igp = SocketLevel(85)
|
||||
pub const ipproto_igrp = SocketLevel(88)
|
||||
pub const ipproto_il = SocketLevel(40)
|
||||
pub const ipproto_inlsp = SocketLevel(52)
|
||||
pub const ipproto_inp = SocketLevel(32)
|
||||
pub const ipproto_ipcomp = SocketLevel(108)
|
||||
pub const ipproto_ipcv = SocketLevel(71)
|
||||
pub const ipproto_ipeip = SocketLevel(94)
|
||||
pub const ipproto_ipip = SocketLevel(4)
|
||||
pub const ipproto_ippc = SocketLevel(67)
|
||||
pub const ipproto_ipv4 = SocketLevel(4)
|
||||
pub const ipproto_ipv6 = SocketLevel(41)
|
||||
pub const ipproto_ip = SocketLevel(0)
|
||||
pub const ipproto_irtp = SocketLevel(28)
|
||||
pub const ipproto_kryptolan = SocketLevel(65)
|
||||
pub const ipproto_larp = SocketLevel(91)
|
||||
pub const ipproto_leaf1 = SocketLevel(25)
|
||||
pub const ipproto_leaf2 = SocketLevel(26)
|
||||
pub const ipproto_max = SocketLevel(256)
|
||||
pub const ipproto_meas = SocketLevel(19)
|
||||
pub const ipproto_mhrp = SocketLevel(48)
|
||||
pub const ipproto_mh = SocketLevel(135)
|
||||
pub const ipproto_micp = SocketLevel(95)
|
||||
pub const ipproto_mobile = SocketLevel(55)
|
||||
pub const ipproto_mpls = SocketLevel(137)
|
||||
pub const ipproto_mtp = SocketLevel(92)
|
||||
pub const ipproto_mux = SocketLevel(18)
|
||||
pub const ipproto_nd = SocketLevel(77)
|
||||
pub const ipproto_nhrp = SocketLevel(54)
|
||||
pub const ipproto_none = SocketLevel(59)
|
||||
pub const ipproto_nsp = SocketLevel(31)
|
||||
pub const ipproto_nvpii = SocketLevel(11)
|
||||
pub const ipproto_old_divert = SocketLevel(254)
|
||||
pub const ipproto_ospfigp = SocketLevel(89)
|
||||
pub const ipproto_pfsync = SocketLevel(240)
|
||||
pub const ipproto_pgm = SocketLevel(113)
|
||||
pub const ipproto_pigp = SocketLevel(9)
|
||||
pub const ipproto_pim = SocketLevel(103)
|
||||
pub const ipproto_prm = SocketLevel(21)
|
||||
pub const ipproto_pup = SocketLevel(12)
|
||||
pub const ipproto_pvp = SocketLevel(75)
|
||||
pub const ipproto_raw = SocketLevel(255)
|
||||
pub const ipproto_rccmon = SocketLevel(10)
|
||||
pub const ipproto_rdp = SocketLevel(27)
|
||||
pub const ipproto_reserved_253 = SocketLevel(253)
|
||||
pub const ipproto_reserved_254 = SocketLevel(254)
|
||||
pub const ipproto_routing = SocketLevel(43)
|
||||
pub const ipproto_rsvp = SocketLevel(46)
|
||||
pub const ipproto_rvd = SocketLevel(66)
|
||||
pub const ipproto_satexpak = SocketLevel(64)
|
||||
pub const ipproto_satmon = SocketLevel(69)
|
||||
pub const ipproto_sccsp = SocketLevel(96)
|
||||
pub const ipproto_sctp = SocketLevel(132)
|
||||
pub const ipproto_sdrp = SocketLevel(42)
|
||||
pub const ipproto_send = SocketLevel(259)
|
||||
pub const ipproto_shim6 = SocketLevel(140)
|
||||
pub const ipproto_skip = SocketLevel(57)
|
||||
pub const ipproto_spacer = SocketLevel(32767)
|
||||
pub const ipproto_srpc = SocketLevel(90)
|
||||
pub const ipproto_st = SocketLevel(7)
|
||||
pub const ipproto_svmtp = SocketLevel(82)
|
||||
pub const ipproto_swipe = SocketLevel(53)
|
||||
pub const ipproto_tcf = SocketLevel(87)
|
||||
pub const ipproto_tcp = SocketLevel(6)
|
||||
pub const ipproto_tlsp = SocketLevel(56)
|
||||
pub const ipproto_tpxx = SocketLevel(39)
|
||||
pub const ipproto_tp = SocketLevel(29)
|
||||
pub const ipproto_trunk1 = SocketLevel(23)
|
||||
pub const ipproto_trunk2 = SocketLevel(24)
|
||||
pub const ipproto_ttp = SocketLevel(84)
|
||||
pub const ipproto_udplite = SocketLevel(136)
|
||||
pub const ipproto_udp = SocketLevel(17)
|
||||
pub const ipproto_vines = SocketLevel(83)
|
||||
pub const ipproto_visa = SocketLevel(70)
|
||||
pub const ipproto_vmtp = SocketLevel(81)
|
||||
pub const ipproto_wbexpak = SocketLevel(79)
|
||||
pub const ipproto_wbmon = SocketLevel(78)
|
||||
pub const ipproto_wsn = SocketLevel(74)
|
||||
pub const ipproto_xnet = SocketLevel(15)
|
||||
pub const ipproto_xtp = SocketLevel(36)
|
||||
pub const ipv6_autoflowlabel = SocketOption(59)
|
||||
pub const ipv6_bindany = SocketOption(64)
|
||||
pub const ipv6_bindv6only = SocketOption(27)
|
||||
pub const ipv6_checksum = SocketOption(26)
|
||||
pub const ipv6_default_multicast_hops = SocketOption(1)
|
||||
pub const ipv6_default_multicast_loop = SocketOption(1)
|
||||
pub const ipv6_dontfrag = SocketOption(62)
|
||||
pub const ipv6_dstopts = SocketOption(50)
|
||||
pub const ipv6_flowid = SocketOption(67)
|
||||
pub const ipv6_flowtype = SocketOption(68)
|
||||
pub const ipv6_fw_add = SocketOption(30)
|
||||
pub const ipv6_fw_del = SocketOption(31)
|
||||
pub const ipv6_fw_flush = SocketOption(32)
|
||||
pub const ipv6_fw_get = SocketOption(34)
|
||||
pub const ipv6_fw_zero = SocketOption(33)
|
||||
pub const ipv6_hoplimit = SocketOption(47)
|
||||
pub const ipv6_hopopts = SocketOption(49)
|
||||
pub const ipv6_ipsec_policy = SocketOption(28)
|
||||
pub const ipv6_join_group = SocketOption(12)
|
||||
pub const ipv6_leave_group = SocketOption(13)
|
||||
pub const ipv6_max_group_src_filter = SocketOption(512)
|
||||
pub const ipv6_max_memberships = SocketOption(4095)
|
||||
pub const ipv6_max_sock_src_filter = SocketOption(128)
|
||||
pub const ipv6_msfilter = SocketOption(74)
|
||||
pub const ipv6_multicast_hops = SocketOption(10)
|
||||
pub const ipv6_multicast_if = SocketOption(9)
|
||||
pub const ipv6_multicast_loop = SocketOption(11)
|
||||
pub const ipv6_nexthop = SocketOption(48)
|
||||
pub const ipv6_origdstaddr = SocketOption(72)
|
||||
pub const ipv6_pathmtu = SocketOption(44)
|
||||
pub const ipv6_pktinfo = SocketOption(46)
|
||||
pub const ipv6_portrange = SocketOption(14)
|
||||
pub const ipv6_portrange_default = SocketOption(0)
|
||||
pub const ipv6_portrange_high = SocketOption(1)
|
||||
pub const ipv6_portrange_low = SocketOption(2)
|
||||
pub const ipv6_prefer_tempaddr = SocketOption(63)
|
||||
pub const ipv6_recvdstopts = SocketOption(40)
|
||||
pub const ipv6_recvflowid = SocketOption(70)
|
||||
pub const ipv6_recvhoplimit = SocketOption(37)
|
||||
pub const ipv6_recvhopopts = SocketOption(39)
|
||||
pub const ipv6_recvorigdstaddr = SocketOption(72)
|
||||
pub const ipv6_recvpathmtu = SocketOption(43)
|
||||
pub const ipv6_recvpktinfo = SocketOption(36)
|
||||
pub const ipv6_recvrssbucketid = SocketOption(71)
|
||||
pub const ipv6_recvrthdr = SocketOption(38)
|
||||
pub const ipv6_recvtclass = SocketOption(57)
|
||||
pub const ipv6_rssbucketid = SocketOption(69)
|
||||
pub const ipv6_rthdrdstopts = SocketOption(35)
|
||||
pub const ipv6_rthdr = SocketOption(51)
|
||||
pub const ipv6_rthdr_loose = SocketOption(0)
|
||||
pub const ipv6_rthdr_strict = SocketOption(1)
|
||||
pub const ipv6_rthdr_type_0 = SocketOption(0)
|
||||
pub const ipv6_sockopt_reserved1 = SocketOption(3)
|
||||
pub const ipv6_tclass = SocketOption(61)
|
||||
pub const ipv6_unicast_hops = SocketOption(4)
|
||||
pub const ipv6_use_min_mtu = SocketOption(42)
|
||||
pub const ipv6_v6only = SocketOption(27)
|
||||
pub const ipv6_vlan_pcp = SocketOption(75)
|
||||
pub const ip_add_membership = SocketOption(12)
|
||||
pub const ip_add_source_membership = SocketOption(70)
|
||||
pub const ip_bindany = SocketOption(24)
|
||||
pub const ip_block_source = SocketOption(72)
|
||||
pub const ip_default_multicast_loop = SocketOption(1)
|
||||
pub const ip_default_multicast_ttl = SocketOption(1)
|
||||
pub const ip_dontfrag = SocketOption(67)
|
||||
pub const ip_drop_membership = SocketOption(13)
|
||||
pub const ip_drop_source_membership = SocketOption(71)
|
||||
pub const ip_dummynet3 = SocketOption(49)
|
||||
pub const ip_dummynet_configure = SocketOption(60)
|
||||
pub const ip_dummynet_del = SocketOption(61)
|
||||
pub const ip_dummynet_flush = SocketOption(62)
|
||||
pub const ip_dummynet_get = SocketOption(64)
|
||||
pub const ip_flowid = SocketOption(90)
|
||||
pub const ip_flowtype = SocketOption(91)
|
||||
pub const ip_fw3 = SocketOption(48)
|
||||
pub const ip_fw_add = SocketOption(50)
|
||||
pub const ip_fw_del = SocketOption(51)
|
||||
pub const ip_fw_flush = SocketOption(52)
|
||||
pub const ip_fw_get = SocketOption(54)
|
||||
pub const ip_fw_nat_cfg = SocketOption(56)
|
||||
pub const ip_fw_nat_del = SocketOption(57)
|
||||
pub const ip_fw_nat_get_config = SocketOption(58)
|
||||
pub const ip_fw_nat_get_log = SocketOption(59)
|
||||
pub const ip_fw_resetlog = SocketOption(55)
|
||||
pub const ip_fw_table_add = SocketOption(40)
|
||||
pub const ip_fw_table_del = SocketOption(41)
|
||||
pub const ip_fw_table_flush = SocketOption(42)
|
||||
pub const ip_fw_table_getsize = SocketOption(43)
|
||||
pub const ip_fw_table_list = SocketOption(44)
|
||||
pub const ip_fw_zero = SocketOption(53)
|
||||
pub const ip_hdrincl = SocketOption(2)
|
||||
pub const ip_ipsec_policy = SocketOption(21)
|
||||
pub const ip_max_group_src_filter = SocketOption(512)
|
||||
pub const ip_max_memberships = SocketOption(4095)
|
||||
pub const ip_max_sock_mute_filter = SocketOption(128)
|
||||
pub const ip_max_sock_src_filter = SocketOption(128)
|
||||
pub const ip_minttl = SocketOption(66)
|
||||
pub const ip_msfilter = SocketOption(74)
|
||||
pub const ip_multicast_if = SocketOption(9)
|
||||
pub const ip_multicast_loop = SocketOption(11)
|
||||
pub const ip_multicast_ttl = SocketOption(10)
|
||||
pub const ip_multicast_vif = SocketOption(14)
|
||||
pub const ip_onesbcast = SocketOption(23)
|
||||
pub const ip_options = SocketOption(1)
|
||||
pub const ip_origdstaddr = SocketOption(27)
|
||||
pub const ip_portrange = SocketOption(19)
|
||||
pub const ip_portrange_default = SocketOption(0)
|
||||
pub const ip_portrange_high = SocketOption(1)
|
||||
pub const ip_portrange_low = SocketOption(2)
|
||||
pub const ip_recvdstaddr = SocketOption(7)
|
||||
pub const ip_recvflowid = SocketOption(93)
|
||||
pub const ip_recvif = SocketOption(20)
|
||||
pub const ip_recvopts = SocketOption(5)
|
||||
pub const ip_recvorigdstaddr = SocketOption(27)
|
||||
pub const ip_recvretopts = SocketOption(6)
|
||||
pub const ip_recvrssbucketid = SocketOption(94)
|
||||
pub const ip_recvtos = SocketOption(68)
|
||||
pub const ip_recvttl = SocketOption(65)
|
||||
pub const ip_retopts = SocketOption(8)
|
||||
pub const ip_rssbucketid = SocketOption(92)
|
||||
pub const ip_rsvp_off = SocketOption(16)
|
||||
pub const ip_rsvp_on = SocketOption(15)
|
||||
pub const ip_rsvp_vif_off = SocketOption(18)
|
||||
pub const ip_rsvp_vif_on = SocketOption(17)
|
||||
pub const ip_sendsrcaddr = SocketOption(7)
|
||||
pub const ip_tos = SocketOption(3)
|
||||
pub const ip_ttl = SocketOption(4)
|
||||
pub const ip_unblock_source = SocketOption(73)
|
||||
pub const ip_vlan_pcp = SocketOption(75)
|
||||
pub const msg_cmsg_cloexec = MsgFlag(262144)
|
||||
pub const msg_cmsg_clofork = MsgFlag(4194304)
|
||||
pub const msg_compat = MsgFlag(32768)
|
||||
pub const msg_ctrunc = MsgFlag(32)
|
||||
pub const msg_dontroute = MsgFlag(4)
|
||||
pub const msg_dontwait = MsgFlag(128)
|
||||
pub const msg_eof = MsgFlag(256)
|
||||
pub const msg_eor = MsgFlag(8)
|
||||
pub const msg_nbio = MsgFlag(16384)
|
||||
pub const msg_nosignal = MsgFlag(131072)
|
||||
pub const msg_notification = MsgFlag(8192)
|
||||
pub const msg_oob = MsgFlag(1)
|
||||
pub const msg_peek = MsgFlag(2)
|
||||
pub const msg_trunc = MsgFlag(16)
|
||||
pub const msg_waitall = MsgFlag(64)
|
||||
pub const msg_waitforone = MsgFlag(524288)
|
||||
pub const ni_dgram = NameInfoFlag(16)
|
||||
pub const ni_maxhost = NameInfoFlag(1025)
|
||||
pub const ni_maxserv = NameInfoFlag(32)
|
||||
pub const ni_namereqd = NameInfoFlag(4)
|
||||
pub const ni_nofqdn = NameInfoFlag(1)
|
||||
pub const ni_numerichost = NameInfoFlag(2)
|
||||
pub const ni_numericscope = NameInfoFlag(32)
|
||||
pub const ni_numericserv = NameInfoFlag(8)
|
||||
pub const sock_cloexec = SocketType(268435456)
|
||||
pub const sock_clofork = SocketType(1073741824)
|
||||
pub const sock_dgram = SocketType(2)
|
||||
pub const sock_maxaddrlen = SocketType(255)
|
||||
pub const sock_nonblock = SocketType(536870912)
|
||||
pub const sock_raw = SocketType(3)
|
||||
pub const sock_rdm = SocketType(4)
|
||||
pub const sock_seqpacket = SocketType(5)
|
||||
pub const sock_stream = SocketType(1)
|
||||
pub const sol_socket = SocketLevel(65535)
|
||||
pub const so_acceptconn = SocketOption(2)
|
||||
pub const so_acceptfilter = SocketOption(4096)
|
||||
pub const so_bintime = SocketOption(8192)
|
||||
pub const so_broadcast = SocketOption(32)
|
||||
pub const so_debug = SocketOption(1)
|
||||
pub const so_domain = SocketOption(4121)
|
||||
pub const so_dontroute = SocketOption(16)
|
||||
pub const so_error = SocketOption(4103)
|
||||
pub const so_fib = SocketOption(4116)
|
||||
pub const so_keepalive = SocketOption(8)
|
||||
pub const so_label = SocketOption(4105)
|
||||
pub const so_linger = SocketOption(128)
|
||||
pub const so_listenincqlen = SocketOption(4115)
|
||||
pub const so_listenqlen = SocketOption(4114)
|
||||
pub const so_listenqlimit = SocketOption(4113)
|
||||
pub const so_max_pacing_rate = SocketOption(4120)
|
||||
pub const so_nosigpipe = SocketOption(2048)
|
||||
pub const so_no_ddp = SocketOption(32768)
|
||||
pub const so_no_offload = SocketOption(16384)
|
||||
pub const so_oobinline = SocketOption(256)
|
||||
pub const so_peerlabel = SocketOption(4112)
|
||||
pub const so_protocol = SocketOption(4118)
|
||||
pub const so_prototype = SocketOption(4118)
|
||||
pub const so_rcvbuf = SocketOption(4098)
|
||||
pub const so_rcvlowat = SocketOption(4100)
|
||||
pub const so_rcvtimeo = SocketOption(4102)
|
||||
pub const so_rerror = SocketOption(131072)
|
||||
pub const so_reuseaddr = SocketOption(4)
|
||||
pub const so_reuseport = SocketOption(512)
|
||||
pub const so_reuseport_lb = SocketOption(65536)
|
||||
pub const so_setfib = SocketOption(4116)
|
||||
pub const so_sndbuf = SocketOption(4097)
|
||||
pub const so_sndlowat = SocketOption(4099)
|
||||
pub const so_sndtimeo = SocketOption(4101)
|
||||
pub const so_splice = SocketOption(4131)
|
||||
pub const so_timestamp = SocketOption(1024)
|
||||
pub const so_ts_bintime = SocketOption(1)
|
||||
pub const so_ts_clock = SocketOption(4119)
|
||||
pub const so_ts_clock_max = SocketOption(3)
|
||||
pub const so_ts_default = SocketOption(0)
|
||||
pub const so_ts_monotonic = SocketOption(3)
|
||||
pub const so_ts_realtime = SocketOption(2)
|
||||
pub const so_ts_realtime_micro = SocketOption(0)
|
||||
pub const so_type = SocketOption(4104)
|
||||
pub const so_useloopback = SocketOption(64)
|
||||
pub const so_user_cookie = SocketOption(4117)
|
||||
-376
@@ -1,376 +0,0 @@
|
||||
module netio
|
||||
|
||||
/*
|
||||
This file is generated by mkconst.sh, DO NOT EDIT.
|
||||
*/
|
||||
|
||||
pub const af_alg = AddrFamily(C.AF_ALG)
|
||||
pub const af_appletalk = AddrFamily(C.AF_APPLETALK)
|
||||
pub const af_ash = AddrFamily(C.AF_ASH)
|
||||
pub const af_atmpvc = AddrFamily(C.AF_ATMPVC)
|
||||
pub const af_atmsvc = AddrFamily(C.AF_ATMSVC)
|
||||
pub const af_ax25 = AddrFamily(C.AF_AX25)
|
||||
pub const af_bluetooth = AddrFamily(C.AF_BLUETOOTH)
|
||||
pub const af_bridge = AddrFamily(C.AF_BRIDGE)
|
||||
pub const af_caif = AddrFamily(C.AF_CAIF)
|
||||
pub const af_can = AddrFamily(C.AF_CAN)
|
||||
pub const af_decnet = AddrFamily(C.AF_DECnet)
|
||||
pub const af_econet = AddrFamily(C.AF_ECONET)
|
||||
pub const af_file = AddrFamily(C.AF_FILE)
|
||||
pub const af_ib = AddrFamily(C.AF_IB)
|
||||
pub const af_ieee802154 = AddrFamily(C.AF_IEEE802154)
|
||||
pub const af_inet6 = AddrFamily(C.AF_INET6)
|
||||
pub const af_inet = AddrFamily(C.AF_INET)
|
||||
pub const af_ipx = AddrFamily(C.AF_IPX)
|
||||
pub const af_irda = AddrFamily(C.AF_IRDA)
|
||||
pub const af_isdn = AddrFamily(C.AF_ISDN)
|
||||
pub const af_iucv = AddrFamily(C.AF_IUCV)
|
||||
pub const af_kcm = AddrFamily(C.AF_KCM)
|
||||
pub const af_key = AddrFamily(C.AF_KEY)
|
||||
pub const af_llc = AddrFamily(C.AF_LLC)
|
||||
pub const af_local = AddrFamily(C.AF_LOCAL)
|
||||
pub const af_max = AddrFamily(C.AF_MAX)
|
||||
pub const af_mctp = AddrFamily(C.AF_MCTP)
|
||||
pub const af_mpls = AddrFamily(C.AF_MPLS)
|
||||
pub const af_netbeui = AddrFamily(C.AF_NETBEUI)
|
||||
pub const af_netlink = AddrFamily(C.AF_NETLINK)
|
||||
pub const af_netrom = AddrFamily(C.AF_NETROM)
|
||||
pub const af_nfc = AddrFamily(C.AF_NFC)
|
||||
pub const af_packet = AddrFamily(C.AF_PACKET)
|
||||
pub const af_phonet = AddrFamily(C.AF_PHONET)
|
||||
pub const af_pppox = AddrFamily(C.AF_PPPOX)
|
||||
pub const af_qipcrtr = AddrFamily(C.AF_QIPCRTR)
|
||||
pub const af_rds = AddrFamily(C.AF_RDS)
|
||||
pub const af_rose = AddrFamily(C.AF_ROSE)
|
||||
pub const af_route = AddrFamily(C.AF_ROUTE)
|
||||
pub const af_rxrpc = AddrFamily(C.AF_RXRPC)
|
||||
pub const af_security = AddrFamily(C.AF_SECURITY)
|
||||
pub const af_smc = AddrFamily(C.AF_SMC)
|
||||
pub const af_sna = AddrFamily(C.AF_SNA)
|
||||
pub const af_tipc = AddrFamily(C.AF_TIPC)
|
||||
pub const af_unix = AddrFamily(C.AF_UNIX)
|
||||
pub const af_unspec = AddrFamily(C.AF_UNSPEC)
|
||||
pub const af_vsock = AddrFamily(C.AF_VSOCK)
|
||||
pub const af_wanpipe = AddrFamily(C.AF_WANPIPE)
|
||||
pub const af_x25 = AddrFamily(C.AF_X25)
|
||||
pub const af_xdp = AddrFamily(C.AF_XDP)
|
||||
pub const ai_addrconfig = AddrInfoFlag(C.AI_ADDRCONFIG)
|
||||
pub const ai_all = AddrInfoFlag(C.AI_ALL)
|
||||
pub const ai_canonname = AddrInfoFlag(C.AI_CANONNAME)
|
||||
pub const ai_numerichost = AddrInfoFlag(C.AI_NUMERICHOST)
|
||||
pub const ai_numericserv = AddrInfoFlag(C.AI_NUMERICSERV)
|
||||
pub const ai_passive = AddrInfoFlag(C.AI_PASSIVE)
|
||||
pub const ai_v4mapped = AddrInfoFlag(C.AI_V4MAPPED)
|
||||
pub const ipproto_ah = SocketLevel(C.IPPROTO_AH)
|
||||
pub const ipproto_beetph = SocketLevel(C.IPPROTO_BEETPH)
|
||||
pub const ipproto_comp = SocketLevel(C.IPPROTO_COMP)
|
||||
pub const ipproto_dccp = SocketLevel(C.IPPROTO_DCCP)
|
||||
pub const ipproto_dstopts = SocketLevel(C.IPPROTO_DSTOPTS)
|
||||
pub const ipproto_egp = SocketLevel(C.IPPROTO_EGP)
|
||||
pub const ipproto_encap = SocketLevel(C.IPPROTO_ENCAP)
|
||||
pub const ipproto_esp = SocketLevel(C.IPPROTO_ESP)
|
||||
pub const ipproto_ethernet = SocketLevel(C.IPPROTO_ETHERNET)
|
||||
pub const ipproto_fragment = SocketLevel(C.IPPROTO_FRAGMENT)
|
||||
pub const ipproto_gre = SocketLevel(C.IPPROTO_GRE)
|
||||
pub const ipproto_hopopts = SocketLevel(C.IPPROTO_HOPOPTS)
|
||||
pub const ipproto_icmpv6 = SocketLevel(C.IPPROTO_ICMPV6)
|
||||
pub const ipproto_icmp = SocketLevel(C.IPPROTO_ICMP)
|
||||
pub const ipproto_idp = SocketLevel(C.IPPROTO_IDP)
|
||||
pub const ipproto_igmp = SocketLevel(C.IPPROTO_IGMP)
|
||||
pub const ipproto_ipip = SocketLevel(C.IPPROTO_IPIP)
|
||||
pub const ipproto_ipv6 = SocketLevel(C.IPPROTO_IPV6)
|
||||
pub const ipproto_ip = SocketLevel(C.IPPROTO_IP)
|
||||
pub const ipproto_l2tp = SocketLevel(C.IPPROTO_L2TP)
|
||||
pub const ipproto_mh = SocketLevel(C.IPPROTO_MH)
|
||||
pub const ipproto_mpls = SocketLevel(C.IPPROTO_MPLS)
|
||||
pub const ipproto_mptcp = SocketLevel(C.IPPROTO_MPTCP)
|
||||
pub const ipproto_mtp = SocketLevel(C.IPPROTO_MTP)
|
||||
pub const ipproto_none = SocketLevel(C.IPPROTO_NONE)
|
||||
pub const ipproto_pim = SocketLevel(C.IPPROTO_PIM)
|
||||
pub const ipproto_pup = SocketLevel(C.IPPROTO_PUP)
|
||||
pub const ipproto_raw = SocketLevel(C.IPPROTO_RAW)
|
||||
pub const ipproto_routing = SocketLevel(C.IPPROTO_ROUTING)
|
||||
pub const ipproto_rsvp = SocketLevel(C.IPPROTO_RSVP)
|
||||
pub const ipproto_sctp = SocketLevel(C.IPPROTO_SCTP)
|
||||
pub const ipproto_smc = SocketLevel(C.IPPROTO_SMC)
|
||||
pub const ipproto_tcp = SocketLevel(C.IPPROTO_TCP)
|
||||
pub const ipproto_tp = SocketLevel(C.IPPROTO_TP)
|
||||
pub const ipproto_udplite = SocketLevel(C.IPPROTO_UDPLITE)
|
||||
pub const ipproto_udp = SocketLevel(C.IPPROTO_UDP)
|
||||
pub const ipv6_2292dstopts = SocketOption(C.IPV6_2292DSTOPTS)
|
||||
pub const ipv6_2292hoplimit = SocketOption(C.IPV6_2292HOPLIMIT)
|
||||
pub const ipv6_2292hopopts = SocketOption(C.IPV6_2292HOPOPTS)
|
||||
pub const ipv6_2292pktinfo = SocketOption(C.IPV6_2292PKTINFO)
|
||||
pub const ipv6_2292pktoptions = SocketOption(C.IPV6_2292PKTOPTIONS)
|
||||
pub const ipv6_2292rthdr = SocketOption(C.IPV6_2292RTHDR)
|
||||
pub const ipv6_addrform = SocketOption(C.IPV6_ADDRFORM)
|
||||
pub const ipv6_addr_preferences = SocketOption(C.IPV6_ADDR_PREFERENCES)
|
||||
pub const ipv6_add_membership = SocketOption(C.IPV6_ADD_MEMBERSHIP)
|
||||
pub const ipv6_authhdr = SocketOption(C.IPV6_AUTHHDR)
|
||||
pub const ipv6_autoflowlabel = SocketOption(C.IPV6_AUTOFLOWLABEL)
|
||||
pub const ipv6_checksum = SocketOption(C.IPV6_CHECKSUM)
|
||||
pub const ipv6_dontfrag = SocketOption(C.IPV6_DONTFRAG)
|
||||
pub const ipv6_drop_membership = SocketOption(C.IPV6_DROP_MEMBERSHIP)
|
||||
pub const ipv6_dstopts = SocketOption(C.IPV6_DSTOPTS)
|
||||
pub const ipv6_freebind = SocketOption(C.IPV6_FREEBIND)
|
||||
pub const ipv6_hdrincl = SocketOption(C.IPV6_HDRINCL)
|
||||
pub const ipv6_hoplimit = SocketOption(C.IPV6_HOPLIMIT)
|
||||
pub const ipv6_hopopts = SocketOption(C.IPV6_HOPOPTS)
|
||||
pub const ipv6_ipsec_policy = SocketOption(C.IPV6_IPSEC_POLICY)
|
||||
pub const ipv6_join_anycast = SocketOption(C.IPV6_JOIN_ANYCAST)
|
||||
pub const ipv6_join_group = SocketOption(C.IPV6_JOIN_GROUP)
|
||||
pub const ipv6_leave_anycast = SocketOption(C.IPV6_LEAVE_ANYCAST)
|
||||
pub const ipv6_leave_group = SocketOption(C.IPV6_LEAVE_GROUP)
|
||||
pub const ipv6_minhopcount = SocketOption(C.IPV6_MINHOPCOUNT)
|
||||
pub const ipv6_mtu = SocketOption(C.IPV6_MTU)
|
||||
pub const ipv6_mtu_discover = SocketOption(C.IPV6_MTU_DISCOVER)
|
||||
pub const ipv6_multicast_all = SocketOption(C.IPV6_MULTICAST_ALL)
|
||||
pub const ipv6_multicast_hops = SocketOption(C.IPV6_MULTICAST_HOPS)
|
||||
pub const ipv6_multicast_if = SocketOption(C.IPV6_MULTICAST_IF)
|
||||
pub const ipv6_multicast_loop = SocketOption(C.IPV6_MULTICAST_LOOP)
|
||||
pub const ipv6_nexthop = SocketOption(C.IPV6_NEXTHOP)
|
||||
pub const ipv6_origdstaddr = SocketOption(C.IPV6_ORIGDSTADDR)
|
||||
pub const ipv6_pathmtu = SocketOption(C.IPV6_PATHMTU)
|
||||
pub const ipv6_pktinfo = SocketOption(C.IPV6_PKTINFO)
|
||||
pub const ipv6_pmtudisc_dont = SocketOption(C.IPV6_PMTUDISC_DONT)
|
||||
pub const ipv6_pmtudisc_do = SocketOption(C.IPV6_PMTUDISC_DO)
|
||||
pub const ipv6_pmtudisc_interface = SocketOption(C.IPV6_PMTUDISC_INTERFACE)
|
||||
pub const ipv6_pmtudisc_omit = SocketOption(C.IPV6_PMTUDISC_OMIT)
|
||||
pub const ipv6_pmtudisc_probe = SocketOption(C.IPV6_PMTUDISC_PROBE)
|
||||
pub const ipv6_pmtudisc_want = SocketOption(C.IPV6_PMTUDISC_WANT)
|
||||
pub const ipv6_recvdstopts = SocketOption(C.IPV6_RECVDSTOPTS)
|
||||
pub const ipv6_recverr = SocketOption(C.IPV6_RECVERR)
|
||||
pub const ipv6_recverr_rfc4884 = SocketOption(C.IPV6_RECVERR_RFC4884)
|
||||
pub const ipv6_recvfragsize = SocketOption(C.IPV6_RECVFRAGSIZE)
|
||||
pub const ipv6_recvhoplimit = SocketOption(C.IPV6_RECVHOPLIMIT)
|
||||
pub const ipv6_recvhopopts = SocketOption(C.IPV6_RECVHOPOPTS)
|
||||
pub const ipv6_recvorigdstaddr = SocketOption(C.IPV6_RECVORIGDSTADDR)
|
||||
pub const ipv6_recvpathmtu = SocketOption(C.IPV6_RECVPATHMTU)
|
||||
pub const ipv6_recvpktinfo = SocketOption(C.IPV6_RECVPKTINFO)
|
||||
pub const ipv6_recvrthdr = SocketOption(C.IPV6_RECVRTHDR)
|
||||
pub const ipv6_recvtclass = SocketOption(C.IPV6_RECVTCLASS)
|
||||
pub const ipv6_router_alert = SocketOption(C.IPV6_ROUTER_ALERT)
|
||||
pub const ipv6_router_alert_isolate = SocketOption(C.IPV6_ROUTER_ALERT_ISOLATE)
|
||||
pub const ipv6_rthdrdstopts = SocketOption(C.IPV6_RTHDRDSTOPTS)
|
||||
pub const ipv6_rthdr = SocketOption(C.IPV6_RTHDR)
|
||||
pub const ipv6_rthdr_loose = SocketOption(C.IPV6_RTHDR_LOOSE)
|
||||
pub const ipv6_rthdr_strict = SocketOption(C.IPV6_RTHDR_STRICT)
|
||||
pub const ipv6_rthdr_type_0 = SocketOption(C.IPV6_RTHDR_TYPE_0)
|
||||
pub const ipv6_rxdstopts = SocketOption(C.IPV6_RXDSTOPTS)
|
||||
pub const ipv6_rxhopopts = SocketOption(C.IPV6_RXHOPOPTS)
|
||||
pub const ipv6_tclass = SocketOption(C.IPV6_TCLASS)
|
||||
pub const ipv6_transparent = SocketOption(C.IPV6_TRANSPARENT)
|
||||
pub const ipv6_unicast_hops = SocketOption(C.IPV6_UNICAST_HOPS)
|
||||
pub const ipv6_unicast_if = SocketOption(C.IPV6_UNICAST_IF)
|
||||
pub const ipv6_v6only = SocketOption(C.IPV6_V6ONLY)
|
||||
pub const ipv6_xfrm_policy = SocketOption(C.IPV6_XFRM_POLICY)
|
||||
pub const ip_add_membership = SocketOption(C.IP_ADD_MEMBERSHIP)
|
||||
pub const ip_add_source_membership = SocketOption(C.IP_ADD_SOURCE_MEMBERSHIP)
|
||||
pub const ip_bind_address_no_port = SocketOption(C.IP_BIND_ADDRESS_NO_PORT)
|
||||
pub const ip_block_source = SocketOption(C.IP_BLOCK_SOURCE)
|
||||
pub const ip_checksum = SocketOption(C.IP_CHECKSUM)
|
||||
pub const ip_default_multicast_loop = SocketOption(C.IP_DEFAULT_MULTICAST_LOOP)
|
||||
pub const ip_default_multicast_ttl = SocketOption(C.IP_DEFAULT_MULTICAST_TTL)
|
||||
pub const ip_drop_membership = SocketOption(C.IP_DROP_MEMBERSHIP)
|
||||
pub const ip_drop_source_membership = SocketOption(C.IP_DROP_SOURCE_MEMBERSHIP)
|
||||
pub const ip_freebind = SocketOption(C.IP_FREEBIND)
|
||||
pub const ip_hdrincl = SocketOption(C.IP_HDRINCL)
|
||||
pub const ip_ipsec_policy = SocketOption(C.IP_IPSEC_POLICY)
|
||||
pub const ip_local_port_range = SocketOption(C.IP_LOCAL_PORT_RANGE)
|
||||
pub const ip_max_memberships = SocketOption(C.IP_MAX_MEMBERSHIPS)
|
||||
pub const ip_minttl = SocketOption(C.IP_MINTTL)
|
||||
pub const ip_msfilter = SocketOption(C.IP_MSFILTER)
|
||||
pub const ip_mtu = SocketOption(C.IP_MTU)
|
||||
pub const ip_mtu_discover = SocketOption(C.IP_MTU_DISCOVER)
|
||||
pub const ip_multicast_all = SocketOption(C.IP_MULTICAST_ALL)
|
||||
pub const ip_multicast_if = SocketOption(C.IP_MULTICAST_IF)
|
||||
pub const ip_multicast_loop = SocketOption(C.IP_MULTICAST_LOOP)
|
||||
pub const ip_multicast_ttl = SocketOption(C.IP_MULTICAST_TTL)
|
||||
pub const ip_nodefrag = SocketOption(C.IP_NODEFRAG)
|
||||
pub const ip_options = SocketOption(C.IP_OPTIONS)
|
||||
pub const ip_origdstaddr = SocketOption(C.IP_ORIGDSTADDR)
|
||||
pub const ip_passsec = SocketOption(C.IP_PASSSEC)
|
||||
pub const ip_pktinfo = SocketOption(C.IP_PKTINFO)
|
||||
pub const ip_pktoptions = SocketOption(C.IP_PKTOPTIONS)
|
||||
pub const ip_pmtudisc = SocketOption(C.IP_PMTUDISC)
|
||||
pub const ip_pmtudisc_dont = SocketOption(C.IP_PMTUDISC_DONT)
|
||||
pub const ip_pmtudisc_do = SocketOption(C.IP_PMTUDISC_DO)
|
||||
pub const ip_pmtudisc_interface = SocketOption(C.IP_PMTUDISC_INTERFACE)
|
||||
pub const ip_pmtudisc_omit = SocketOption(C.IP_PMTUDISC_OMIT)
|
||||
pub const ip_pmtudisc_probe = SocketOption(C.IP_PMTUDISC_PROBE)
|
||||
pub const ip_pmtudisc_want = SocketOption(C.IP_PMTUDISC_WANT)
|
||||
pub const ip_protocol = SocketOption(C.IP_PROTOCOL)
|
||||
pub const ip_recverr = SocketOption(C.IP_RECVERR)
|
||||
pub const ip_recverr_rfc4884 = SocketOption(C.IP_RECVERR_RFC4884)
|
||||
pub const ip_recvfragsize = SocketOption(C.IP_RECVFRAGSIZE)
|
||||
pub const ip_recvopts = SocketOption(C.IP_RECVOPTS)
|
||||
pub const ip_recvorigdstaddr = SocketOption(C.IP_RECVORIGDSTADDR)
|
||||
pub const ip_recvretopts = SocketOption(C.IP_RECVRETOPTS)
|
||||
pub const ip_recvtos = SocketOption(C.IP_RECVTOS)
|
||||
pub const ip_recvttl = SocketOption(C.IP_RECVTTL)
|
||||
pub const ip_retopts = SocketOption(C.IP_RETOPTS)
|
||||
pub const ip_router_alert = SocketOption(C.IP_ROUTER_ALERT)
|
||||
pub const ip_tos = SocketOption(C.IP_TOS)
|
||||
pub const ip_transparent = SocketOption(C.IP_TRANSPARENT)
|
||||
pub const ip_ttl = SocketOption(C.IP_TTL)
|
||||
pub const ip_unblock_source = SocketOption(C.IP_UNBLOCK_SOURCE)
|
||||
pub const ip_unicast_if = SocketOption(C.IP_UNICAST_IF)
|
||||
pub const ip_xfrm_policy = SocketOption(C.IP_XFRM_POLICY)
|
||||
pub const msg_batch = MsgFlag(C.MSG_BATCH)
|
||||
pub const msg_cmsg_cloexec = MsgFlag(C.MSG_CMSG_CLOEXEC)
|
||||
pub const msg_confirm = MsgFlag(C.MSG_CONFIRM)
|
||||
pub const msg_ctrunc = MsgFlag(C.MSG_CTRUNC)
|
||||
pub const msg_dontroute = MsgFlag(C.MSG_DONTROUTE)
|
||||
pub const msg_dontwait = MsgFlag(C.MSG_DONTWAIT)
|
||||
pub const msg_eor = MsgFlag(C.MSG_EOR)
|
||||
pub const msg_errqueue = MsgFlag(C.MSG_ERRQUEUE)
|
||||
pub const msg_fastopen = MsgFlag(C.MSG_FASTOPEN)
|
||||
pub const msg_fin = MsgFlag(C.MSG_FIN)
|
||||
pub const msg_more = MsgFlag(C.MSG_MORE)
|
||||
pub const msg_nosignal = MsgFlag(C.MSG_NOSIGNAL)
|
||||
pub const msg_oob = MsgFlag(C.MSG_OOB)
|
||||
pub const msg_peek = MsgFlag(C.MSG_PEEK)
|
||||
pub const msg_proxy = MsgFlag(C.MSG_PROXY)
|
||||
pub const msg_rst = MsgFlag(C.MSG_RST)
|
||||
pub const msg_sock_devmem = MsgFlag(C.MSG_SOCK_DEVMEM)
|
||||
pub const msg_syn = MsgFlag(C.MSG_SYN)
|
||||
pub const msg_trunc = MsgFlag(C.MSG_TRUNC)
|
||||
pub const msg_waitall = MsgFlag(C.MSG_WAITALL)
|
||||
pub const msg_waitforone = MsgFlag(C.MSG_WAITFORONE)
|
||||
pub const msg_zerocopy = MsgFlag(C.MSG_ZEROCOPY)
|
||||
pub const ni_dgram = NameInfoFlag(C.NI_DGRAM)
|
||||
pub const ni_maxhost = NameInfoFlag(C.NI_MAXHOST)
|
||||
pub const ni_maxserv = NameInfoFlag(C.NI_MAXSERV)
|
||||
pub const ni_namereqd = NameInfoFlag(C.NI_NAMEREQD)
|
||||
pub const ni_nofqdn = NameInfoFlag(C.NI_NOFQDN)
|
||||
pub const ni_numerichost = NameInfoFlag(C.NI_NUMERICHOST)
|
||||
pub const ni_numericserv = NameInfoFlag(C.NI_NUMERICSERV)
|
||||
pub const sock_cloexec = SocketType(C.SOCK_CLOEXEC)
|
||||
pub const sock_dccp = SocketType(C.SOCK_DCCP)
|
||||
pub const sock_dgram = SocketType(C.SOCK_DGRAM)
|
||||
pub const sock_nonblock = SocketType(C.SOCK_NONBLOCK)
|
||||
pub const sock_packet = SocketType(C.SOCK_PACKET)
|
||||
pub const sock_raw = SocketType(C.SOCK_RAW)
|
||||
pub const sock_rdm = SocketType(C.SOCK_RDM)
|
||||
pub const sock_seqpacket = SocketType(C.SOCK_SEQPACKET)
|
||||
pub const sock_stream = SocketType(C.SOCK_STREAM)
|
||||
pub const sol_aal = SocketLevel(C.SOL_AAL)
|
||||
pub const sol_alg = SocketLevel(C.SOL_ALG)
|
||||
pub const sol_atm = SocketLevel(C.SOL_ATM)
|
||||
pub const sol_bluetooth = SocketLevel(C.SOL_BLUETOOTH)
|
||||
pub const sol_caif = SocketLevel(C.SOL_CAIF)
|
||||
pub const sol_dccp = SocketLevel(C.SOL_DCCP)
|
||||
pub const sol_decnet = SocketLevel(C.SOL_DECNET)
|
||||
pub const sol_icmpv6 = SocketLevel(C.SOL_ICMPV6)
|
||||
pub const sol_ipv6 = SocketLevel(C.SOL_IPV6)
|
||||
pub const sol_ip = SocketLevel(C.SOL_IP)
|
||||
pub const sol_irda = SocketLevel(C.SOL_IRDA)
|
||||
pub const sol_iucv = SocketLevel(C.SOL_IUCV)
|
||||
pub const sol_kcm = SocketLevel(C.SOL_KCM)
|
||||
pub const sol_llc = SocketLevel(C.SOL_LLC)
|
||||
pub const sol_mctp = SocketLevel(C.SOL_MCTP)
|
||||
pub const sol_mptcp = SocketLevel(C.SOL_MPTCP)
|
||||
pub const sol_netbeui = SocketLevel(C.SOL_NETBEUI)
|
||||
pub const sol_netlink = SocketLevel(C.SOL_NETLINK)
|
||||
pub const sol_nfc = SocketLevel(C.SOL_NFC)
|
||||
pub const sol_packet = SocketLevel(C.SOL_PACKET)
|
||||
pub const sol_pnpipe = SocketLevel(C.SOL_PNPIPE)
|
||||
pub const sol_pppol2tp = SocketLevel(C.SOL_PPPOL2TP)
|
||||
pub const sol_raw = SocketLevel(C.SOL_RAW)
|
||||
pub const sol_rds = SocketLevel(C.SOL_RDS)
|
||||
pub const sol_rxrpc = SocketLevel(C.SOL_RXRPC)
|
||||
pub const sol_smc = SocketLevel(C.SOL_SMC)
|
||||
pub const sol_socket = SocketLevel(C.SOL_SOCKET)
|
||||
pub const sol_tipc = SocketLevel(C.SOL_TIPC)
|
||||
pub const sol_tls = SocketLevel(C.SOL_TLS)
|
||||
pub const sol_vsock = SocketLevel(C.SOL_VSOCK)
|
||||
pub const sol_x25 = SocketLevel(C.SOL_X25)
|
||||
pub const sol_xdp = SocketLevel(C.SOL_XDP)
|
||||
pub const so_acceptconn = SocketOption(C.SO_ACCEPTCONN)
|
||||
pub const so_attach_bpf = SocketOption(C.SO_ATTACH_BPF)
|
||||
pub const so_attach_filter = SocketOption(C.SO_ATTACH_FILTER)
|
||||
pub const so_attach_reuseport_cbpf = SocketOption(C.SO_ATTACH_REUSEPORT_CBPF)
|
||||
pub const so_attach_reuseport_ebpf = SocketOption(C.SO_ATTACH_REUSEPORT_EBPF)
|
||||
pub const so_bindtodevice = SocketOption(C.SO_BINDTODEVICE)
|
||||
pub const so_bindtoifindex = SocketOption(C.SO_BINDTOIFINDEX)
|
||||
pub const so_bpf_extensions = SocketOption(C.SO_BPF_EXTENSIONS)
|
||||
pub const so_broadcast = SocketOption(C.SO_BROADCAST)
|
||||
pub const so_bsdcompat = SocketOption(C.SO_BSDCOMPAT)
|
||||
pub const so_buf_lock = SocketOption(C.SO_BUF_LOCK)
|
||||
pub const so_busy_poll = SocketOption(C.SO_BUSY_POLL)
|
||||
pub const so_busy_poll_budget = SocketOption(C.SO_BUSY_POLL_BUDGET)
|
||||
pub const so_cnx_advice = SocketOption(C.SO_CNX_ADVICE)
|
||||
pub const so_cookie = SocketOption(C.SO_COOKIE)
|
||||
pub const so_debug = SocketOption(C.SO_DEBUG)
|
||||
pub const so_detach_bpf = SocketOption(C.SO_DETACH_BPF)
|
||||
pub const so_detach_filter = SocketOption(C.SO_DETACH_FILTER)
|
||||
pub const so_detach_reuseport_bpf = SocketOption(C.SO_DETACH_REUSEPORT_BPF)
|
||||
pub const so_devmem_dmabuf = SocketOption(C.SO_DEVMEM_DMABUF)
|
||||
pub const so_devmem_dontneed = SocketOption(C.SO_DEVMEM_DONTNEED)
|
||||
pub const so_devmem_linear = SocketOption(C.SO_DEVMEM_LINEAR)
|
||||
pub const so_domain = SocketOption(C.SO_DOMAIN)
|
||||
pub const so_dontroute = SocketOption(C.SO_DONTROUTE)
|
||||
pub const so_error = SocketOption(C.SO_ERROR)
|
||||
pub const so_get_filter = SocketOption(C.SO_GET_FILTER)
|
||||
pub const so_incoming_cpu = SocketOption(C.SO_INCOMING_CPU)
|
||||
pub const so_incoming_napi_id = SocketOption(C.SO_INCOMING_NAPI_ID)
|
||||
pub const so_inq = SocketOption(C.SO_INQ)
|
||||
pub const so_keepalive = SocketOption(C.SO_KEEPALIVE)
|
||||
pub const so_linger = SocketOption(C.SO_LINGER)
|
||||
pub const so_lock_filter = SocketOption(C.SO_LOCK_FILTER)
|
||||
pub const so_mark = SocketOption(C.SO_MARK)
|
||||
pub const so_max_pacing_rate = SocketOption(C.SO_MAX_PACING_RATE)
|
||||
pub const so_meminfo = SocketOption(C.SO_MEMINFO)
|
||||
pub const so_netns_cookie = SocketOption(C.SO_NETNS_COOKIE)
|
||||
pub const so_nofcs = SocketOption(C.SO_NOFCS)
|
||||
pub const so_no_check = SocketOption(C.SO_NO_CHECK)
|
||||
pub const so_oobinline = SocketOption(C.SO_OOBINLINE)
|
||||
pub const so_passcred = SocketOption(C.SO_PASSCRED)
|
||||
pub const so_passpidfd = SocketOption(C.SO_PASSPIDFD)
|
||||
pub const so_passrights = SocketOption(C.SO_PASSRIGHTS)
|
||||
pub const so_passsec = SocketOption(C.SO_PASSSEC)
|
||||
pub const so_peek_off = SocketOption(C.SO_PEEK_OFF)
|
||||
pub const so_peercred = SocketOption(C.SO_PEERCRED)
|
||||
pub const so_peergroups = SocketOption(C.SO_PEERGROUPS)
|
||||
pub const so_peername = SocketOption(C.SO_PEERNAME)
|
||||
pub const so_peerpidfd = SocketOption(C.SO_PEERPIDFD)
|
||||
pub const so_peersec = SocketOption(C.SO_PEERSEC)
|
||||
pub const so_prefer_busy_poll = SocketOption(C.SO_PREFER_BUSY_POLL)
|
||||
pub const so_priority = SocketOption(C.SO_PRIORITY)
|
||||
pub const so_protocol = SocketOption(C.SO_PROTOCOL)
|
||||
pub const so_rcvbufforce = SocketOption(C.SO_RCVBUFFORCE)
|
||||
pub const so_rcvbuf = SocketOption(C.SO_RCVBUF)
|
||||
pub const so_rcvlowat = SocketOption(C.SO_RCVLOWAT)
|
||||
pub const so_rcvmark = SocketOption(C.SO_RCVMARK)
|
||||
pub const so_rcvpriority = SocketOption(C.SO_RCVPRIORITY)
|
||||
pub const so_rcvtimeo = SocketOption(C.SO_RCVTIMEO)
|
||||
pub const so_rcvtimeo_new = SocketOption(C.SO_RCVTIMEO_NEW)
|
||||
pub const so_rcvtimeo_old = SocketOption(C.SO_RCVTIMEO_OLD)
|
||||
pub const so_reserve_mem = SocketOption(C.SO_RESERVE_MEM)
|
||||
pub const so_reuseaddr = SocketOption(C.SO_REUSEADDR)
|
||||
pub const so_reuseport = SocketOption(C.SO_REUSEPORT)
|
||||
pub const so_rxq_ovfl = SocketOption(C.SO_RXQ_OVFL)
|
||||
pub const so_security_authentication = SocketOption(C.SO_SECURITY_AUTHENTICATION)
|
||||
pub const so_security_encryption_network = SocketOption(C.SO_SECURITY_ENCRYPTION_NETWORK)
|
||||
pub const so_security_encryption_transport = SocketOption(C.SO_SECURITY_ENCRYPTION_TRANSPORT)
|
||||
pub const so_select_err_queue = SocketOption(C.SO_SELECT_ERR_QUEUE)
|
||||
pub const so_sndbufforce = SocketOption(C.SO_SNDBUFFORCE)
|
||||
pub const so_sndbuf = SocketOption(C.SO_SNDBUF)
|
||||
pub const so_sndlowat = SocketOption(C.SO_SNDLOWAT)
|
||||
pub const so_sndtimeo = SocketOption(C.SO_SNDTIMEO)
|
||||
pub const so_sndtimeo_new = SocketOption(C.SO_SNDTIMEO_NEW)
|
||||
pub const so_sndtimeo_old = SocketOption(C.SO_SNDTIMEO_OLD)
|
||||
pub const so_timestamping = SocketOption(C.SO_TIMESTAMPING)
|
||||
pub const so_timestamping_new = SocketOption(C.SO_TIMESTAMPING_NEW)
|
||||
pub const so_timestamping_old = SocketOption(C.SO_TIMESTAMPING_OLD)
|
||||
pub const so_timestampns = SocketOption(C.SO_TIMESTAMPNS)
|
||||
pub const so_timestampns_new = SocketOption(C.SO_TIMESTAMPNS_NEW)
|
||||
pub const so_timestampns_old = SocketOption(C.SO_TIMESTAMPNS_OLD)
|
||||
pub const so_timestamp = SocketOption(C.SO_TIMESTAMP)
|
||||
pub const so_timestamp_new = SocketOption(C.SO_TIMESTAMP_NEW)
|
||||
pub const so_timestamp_old = SocketOption(C.SO_TIMESTAMP_OLD)
|
||||
pub const so_txrehash = SocketOption(C.SO_TXREHASH)
|
||||
pub const so_txtime = SocketOption(C.SO_TXTIME)
|
||||
pub const so_type = SocketOption(C.SO_TYPE)
|
||||
pub const so_wifi_status = SocketOption(C.SO_WIFI_STATUS)
|
||||
pub const so_zerocopy = SocketOption(C.SO_ZEROCOPY)
|
||||
+376
@@ -0,0 +1,376 @@
|
||||
module netio
|
||||
|
||||
/*
|
||||
This file is generated by make.vsh, DO NOT EDIT.
|
||||
*/
|
||||
|
||||
pub const af_alg = AddrFamily(38)
|
||||
pub const af_appletalk = AddrFamily(5)
|
||||
pub const af_ash = AddrFamily(18)
|
||||
pub const af_atmpvc = AddrFamily(8)
|
||||
pub const af_atmsvc = AddrFamily(20)
|
||||
pub const af_ax25 = AddrFamily(3)
|
||||
pub const af_bluetooth = AddrFamily(31)
|
||||
pub const af_bridge = AddrFamily(7)
|
||||
pub const af_caif = AddrFamily(37)
|
||||
pub const af_can = AddrFamily(29)
|
||||
pub const af_decnet = AddrFamily(12)
|
||||
pub const af_econet = AddrFamily(19)
|
||||
pub const af_file = AddrFamily(1)
|
||||
pub const af_ib = AddrFamily(27)
|
||||
pub const af_ieee802154 = AddrFamily(36)
|
||||
pub const af_inet6 = AddrFamily(10)
|
||||
pub const af_inet = AddrFamily(2)
|
||||
pub const af_ipx = AddrFamily(4)
|
||||
pub const af_irda = AddrFamily(23)
|
||||
pub const af_isdn = AddrFamily(34)
|
||||
pub const af_iucv = AddrFamily(32)
|
||||
pub const af_kcm = AddrFamily(41)
|
||||
pub const af_key = AddrFamily(15)
|
||||
pub const af_llc = AddrFamily(26)
|
||||
pub const af_local = AddrFamily(1)
|
||||
pub const af_max = AddrFamily(46)
|
||||
pub const af_mctp = AddrFamily(45)
|
||||
pub const af_mpls = AddrFamily(28)
|
||||
pub const af_netbeui = AddrFamily(13)
|
||||
pub const af_netlink = AddrFamily(16)
|
||||
pub const af_netrom = AddrFamily(6)
|
||||
pub const af_nfc = AddrFamily(39)
|
||||
pub const af_packet = AddrFamily(17)
|
||||
pub const af_phonet = AddrFamily(35)
|
||||
pub const af_pppox = AddrFamily(24)
|
||||
pub const af_qipcrtr = AddrFamily(42)
|
||||
pub const af_rds = AddrFamily(21)
|
||||
pub const af_rose = AddrFamily(11)
|
||||
pub const af_route = AddrFamily(16)
|
||||
pub const af_rxrpc = AddrFamily(33)
|
||||
pub const af_security = AddrFamily(14)
|
||||
pub const af_smc = AddrFamily(43)
|
||||
pub const af_sna = AddrFamily(22)
|
||||
pub const af_tipc = AddrFamily(30)
|
||||
pub const af_unix = AddrFamily(1)
|
||||
pub const af_unspec = AddrFamily(0)
|
||||
pub const af_vsock = AddrFamily(40)
|
||||
pub const af_wanpipe = AddrFamily(25)
|
||||
pub const af_x25 = AddrFamily(9)
|
||||
pub const af_xdp = AddrFamily(44)
|
||||
pub const ai_addrconfig = AddrInfoFlag(32)
|
||||
pub const ai_all = AddrInfoFlag(16)
|
||||
pub const ai_canonname = AddrInfoFlag(2)
|
||||
pub const ai_numerichost = AddrInfoFlag(4)
|
||||
pub const ai_numericserv = AddrInfoFlag(1024)
|
||||
pub const ai_passive = AddrInfoFlag(1)
|
||||
pub const ai_v4mapped = AddrInfoFlag(8)
|
||||
pub const ipproto_ah = SocketLevel(51)
|
||||
pub const ipproto_beetph = SocketLevel(94)
|
||||
pub const ipproto_comp = SocketLevel(108)
|
||||
pub const ipproto_dccp = SocketLevel(33)
|
||||
pub const ipproto_dstopts = SocketLevel(60)
|
||||
pub const ipproto_egp = SocketLevel(8)
|
||||
pub const ipproto_encap = SocketLevel(98)
|
||||
pub const ipproto_esp = SocketLevel(50)
|
||||
pub const ipproto_ethernet = SocketLevel(143)
|
||||
pub const ipproto_fragment = SocketLevel(44)
|
||||
pub const ipproto_gre = SocketLevel(47)
|
||||
pub const ipproto_hopopts = SocketLevel(0)
|
||||
pub const ipproto_icmpv6 = SocketLevel(58)
|
||||
pub const ipproto_icmp = SocketLevel(1)
|
||||
pub const ipproto_idp = SocketLevel(22)
|
||||
pub const ipproto_igmp = SocketLevel(2)
|
||||
pub const ipproto_ipip = SocketLevel(4)
|
||||
pub const ipproto_ipv6 = SocketLevel(41)
|
||||
pub const ipproto_ip = SocketLevel(0)
|
||||
pub const ipproto_l2tp = SocketLevel(115)
|
||||
pub const ipproto_mh = SocketLevel(135)
|
||||
pub const ipproto_mpls = SocketLevel(137)
|
||||
pub const ipproto_mptcp = SocketLevel(262)
|
||||
pub const ipproto_mtp = SocketLevel(92)
|
||||
pub const ipproto_none = SocketLevel(59)
|
||||
pub const ipproto_pim = SocketLevel(103)
|
||||
pub const ipproto_pup = SocketLevel(12)
|
||||
pub const ipproto_raw = SocketLevel(255)
|
||||
pub const ipproto_routing = SocketLevel(43)
|
||||
pub const ipproto_rsvp = SocketLevel(46)
|
||||
pub const ipproto_sctp = SocketLevel(132)
|
||||
pub const ipproto_smc = SocketLevel(256)
|
||||
pub const ipproto_tcp = SocketLevel(6)
|
||||
pub const ipproto_tp = SocketLevel(29)
|
||||
pub const ipproto_udplite = SocketLevel(136)
|
||||
pub const ipproto_udp = SocketLevel(17)
|
||||
pub const ipv6_2292dstopts = SocketOption(4)
|
||||
pub const ipv6_2292hoplimit = SocketOption(8)
|
||||
pub const ipv6_2292hopopts = SocketOption(3)
|
||||
pub const ipv6_2292pktinfo = SocketOption(2)
|
||||
pub const ipv6_2292pktoptions = SocketOption(6)
|
||||
pub const ipv6_2292rthdr = SocketOption(5)
|
||||
pub const ipv6_addrform = SocketOption(1)
|
||||
pub const ipv6_addr_preferences = SocketOption(72)
|
||||
pub const ipv6_add_membership = SocketOption(20)
|
||||
pub const ipv6_authhdr = SocketOption(10)
|
||||
pub const ipv6_autoflowlabel = SocketOption(70)
|
||||
pub const ipv6_checksum = SocketOption(7)
|
||||
pub const ipv6_dontfrag = SocketOption(62)
|
||||
pub const ipv6_drop_membership = SocketOption(21)
|
||||
pub const ipv6_dstopts = SocketOption(59)
|
||||
pub const ipv6_freebind = SocketOption(78)
|
||||
pub const ipv6_hdrincl = SocketOption(36)
|
||||
pub const ipv6_hoplimit = SocketOption(52)
|
||||
pub const ipv6_hopopts = SocketOption(54)
|
||||
pub const ipv6_ipsec_policy = SocketOption(34)
|
||||
pub const ipv6_join_anycast = SocketOption(27)
|
||||
pub const ipv6_join_group = SocketOption(20)
|
||||
pub const ipv6_leave_anycast = SocketOption(28)
|
||||
pub const ipv6_leave_group = SocketOption(21)
|
||||
pub const ipv6_minhopcount = SocketOption(73)
|
||||
pub const ipv6_mtu = SocketOption(24)
|
||||
pub const ipv6_mtu_discover = SocketOption(23)
|
||||
pub const ipv6_multicast_all = SocketOption(29)
|
||||
pub const ipv6_multicast_hops = SocketOption(18)
|
||||
pub const ipv6_multicast_if = SocketOption(17)
|
||||
pub const ipv6_multicast_loop = SocketOption(19)
|
||||
pub const ipv6_nexthop = SocketOption(9)
|
||||
pub const ipv6_origdstaddr = SocketOption(74)
|
||||
pub const ipv6_pathmtu = SocketOption(61)
|
||||
pub const ipv6_pktinfo = SocketOption(50)
|
||||
pub const ipv6_pmtudisc_dont = SocketOption(0)
|
||||
pub const ipv6_pmtudisc_do = SocketOption(2)
|
||||
pub const ipv6_pmtudisc_interface = SocketOption(4)
|
||||
pub const ipv6_pmtudisc_omit = SocketOption(5)
|
||||
pub const ipv6_pmtudisc_probe = SocketOption(3)
|
||||
pub const ipv6_pmtudisc_want = SocketOption(1)
|
||||
pub const ipv6_recvdstopts = SocketOption(58)
|
||||
pub const ipv6_recverr = SocketOption(25)
|
||||
pub const ipv6_recverr_rfc4884 = SocketOption(31)
|
||||
pub const ipv6_recvfragsize = SocketOption(77)
|
||||
pub const ipv6_recvhoplimit = SocketOption(51)
|
||||
pub const ipv6_recvhopopts = SocketOption(53)
|
||||
pub const ipv6_recvorigdstaddr = SocketOption(74)
|
||||
pub const ipv6_recvpathmtu = SocketOption(60)
|
||||
pub const ipv6_recvpktinfo = SocketOption(49)
|
||||
pub const ipv6_recvrthdr = SocketOption(56)
|
||||
pub const ipv6_recvtclass = SocketOption(66)
|
||||
pub const ipv6_router_alert = SocketOption(22)
|
||||
pub const ipv6_router_alert_isolate = SocketOption(30)
|
||||
pub const ipv6_rthdrdstopts = SocketOption(55)
|
||||
pub const ipv6_rthdr = SocketOption(57)
|
||||
pub const ipv6_rthdr_loose = SocketOption(0)
|
||||
pub const ipv6_rthdr_strict = SocketOption(1)
|
||||
pub const ipv6_rthdr_type_0 = SocketOption(0)
|
||||
pub const ipv6_rxdstopts = SocketOption(59)
|
||||
pub const ipv6_rxhopopts = SocketOption(54)
|
||||
pub const ipv6_tclass = SocketOption(67)
|
||||
pub const ipv6_transparent = SocketOption(75)
|
||||
pub const ipv6_unicast_hops = SocketOption(16)
|
||||
pub const ipv6_unicast_if = SocketOption(76)
|
||||
pub const ipv6_v6only = SocketOption(26)
|
||||
pub const ipv6_xfrm_policy = SocketOption(35)
|
||||
pub const ip_add_membership = SocketOption(35)
|
||||
pub const ip_add_source_membership = SocketOption(39)
|
||||
pub const ip_bind_address_no_port = SocketOption(24)
|
||||
pub const ip_block_source = SocketOption(38)
|
||||
pub const ip_checksum = SocketOption(23)
|
||||
pub const ip_default_multicast_loop = SocketOption(1)
|
||||
pub const ip_default_multicast_ttl = SocketOption(1)
|
||||
pub const ip_drop_membership = SocketOption(36)
|
||||
pub const ip_drop_source_membership = SocketOption(40)
|
||||
pub const ip_freebind = SocketOption(15)
|
||||
pub const ip_hdrincl = SocketOption(3)
|
||||
pub const ip_ipsec_policy = SocketOption(16)
|
||||
pub const ip_local_port_range = SocketOption(51)
|
||||
pub const ip_max_memberships = SocketOption(20)
|
||||
pub const ip_minttl = SocketOption(21)
|
||||
pub const ip_msfilter = SocketOption(41)
|
||||
pub const ip_mtu = SocketOption(14)
|
||||
pub const ip_mtu_discover = SocketOption(10)
|
||||
pub const ip_multicast_all = SocketOption(49)
|
||||
pub const ip_multicast_if = SocketOption(32)
|
||||
pub const ip_multicast_loop = SocketOption(34)
|
||||
pub const ip_multicast_ttl = SocketOption(33)
|
||||
pub const ip_nodefrag = SocketOption(22)
|
||||
pub const ip_options = SocketOption(4)
|
||||
pub const ip_origdstaddr = SocketOption(20)
|
||||
pub const ip_passsec = SocketOption(18)
|
||||
pub const ip_pktinfo = SocketOption(8)
|
||||
pub const ip_pktoptions = SocketOption(9)
|
||||
pub const ip_pmtudisc = SocketOption(10)
|
||||
pub const ip_pmtudisc_dont = SocketOption(0)
|
||||
pub const ip_pmtudisc_do = SocketOption(2)
|
||||
pub const ip_pmtudisc_interface = SocketOption(4)
|
||||
pub const ip_pmtudisc_omit = SocketOption(5)
|
||||
pub const ip_pmtudisc_probe = SocketOption(3)
|
||||
pub const ip_pmtudisc_want = SocketOption(1)
|
||||
pub const ip_protocol = SocketOption(52)
|
||||
pub const ip_recverr = SocketOption(11)
|
||||
pub const ip_recverr_rfc4884 = SocketOption(26)
|
||||
pub const ip_recvfragsize = SocketOption(25)
|
||||
pub const ip_recvopts = SocketOption(6)
|
||||
pub const ip_recvorigdstaddr = SocketOption(20)
|
||||
pub const ip_recvretopts = SocketOption(7)
|
||||
pub const ip_recvtos = SocketOption(13)
|
||||
pub const ip_recvttl = SocketOption(12)
|
||||
pub const ip_retopts = SocketOption(7)
|
||||
pub const ip_router_alert = SocketOption(5)
|
||||
pub const ip_tos = SocketOption(1)
|
||||
pub const ip_transparent = SocketOption(19)
|
||||
pub const ip_ttl = SocketOption(2)
|
||||
pub const ip_unblock_source = SocketOption(37)
|
||||
pub const ip_unicast_if = SocketOption(50)
|
||||
pub const ip_xfrm_policy = SocketOption(17)
|
||||
pub const msg_batch = MsgFlag(262144)
|
||||
pub const msg_cmsg_cloexec = MsgFlag(1073741824)
|
||||
pub const msg_confirm = MsgFlag(2048)
|
||||
pub const msg_ctrunc = MsgFlag(8)
|
||||
pub const msg_dontroute = MsgFlag(4)
|
||||
pub const msg_dontwait = MsgFlag(64)
|
||||
pub const msg_eor = MsgFlag(128)
|
||||
pub const msg_errqueue = MsgFlag(8192)
|
||||
pub const msg_fastopen = MsgFlag(536870912)
|
||||
pub const msg_fin = MsgFlag(512)
|
||||
pub const msg_more = MsgFlag(32768)
|
||||
pub const msg_nosignal = MsgFlag(16384)
|
||||
pub const msg_oob = MsgFlag(1)
|
||||
pub const msg_peek = MsgFlag(2)
|
||||
pub const msg_proxy = MsgFlag(16)
|
||||
pub const msg_rst = MsgFlag(4096)
|
||||
pub const msg_sock_devmem = MsgFlag(33554432)
|
||||
pub const msg_syn = MsgFlag(1024)
|
||||
pub const msg_trunc = MsgFlag(32)
|
||||
pub const msg_waitall = MsgFlag(256)
|
||||
pub const msg_waitforone = MsgFlag(65536)
|
||||
pub const msg_zerocopy = MsgFlag(67108864)
|
||||
pub const ni_dgram = NameInfoFlag(16)
|
||||
pub const ni_maxhost = NameInfoFlag(1025)
|
||||
pub const ni_maxserv = NameInfoFlag(32)
|
||||
pub const ni_namereqd = NameInfoFlag(8)
|
||||
pub const ni_nofqdn = NameInfoFlag(4)
|
||||
pub const ni_numerichost = NameInfoFlag(1)
|
||||
pub const ni_numericserv = NameInfoFlag(2)
|
||||
pub const sock_cloexec = SocketType(524288)
|
||||
pub const sock_dccp = SocketType(6)
|
||||
pub const sock_dgram = SocketType(2)
|
||||
pub const sock_nonblock = SocketType(2048)
|
||||
pub const sock_packet = SocketType(10)
|
||||
pub const sock_raw = SocketType(3)
|
||||
pub const sock_rdm = SocketType(4)
|
||||
pub const sock_seqpacket = SocketType(5)
|
||||
pub const sock_stream = SocketType(1)
|
||||
pub const sol_aal = SocketLevel(265)
|
||||
pub const sol_alg = SocketLevel(279)
|
||||
pub const sol_atm = SocketLevel(264)
|
||||
pub const sol_bluetooth = SocketLevel(274)
|
||||
pub const sol_caif = SocketLevel(278)
|
||||
pub const sol_dccp = SocketLevel(269)
|
||||
pub const sol_decnet = SocketLevel(261)
|
||||
pub const sol_icmpv6 = SocketLevel(58)
|
||||
pub const sol_ipv6 = SocketLevel(41)
|
||||
pub const sol_ip = SocketLevel(0)
|
||||
pub const sol_irda = SocketLevel(266)
|
||||
pub const sol_iucv = SocketLevel(277)
|
||||
pub const sol_kcm = SocketLevel(281)
|
||||
pub const sol_llc = SocketLevel(268)
|
||||
pub const sol_mctp = SocketLevel(285)
|
||||
pub const sol_mptcp = SocketLevel(284)
|
||||
pub const sol_netbeui = SocketLevel(267)
|
||||
pub const sol_netlink = SocketLevel(270)
|
||||
pub const sol_nfc = SocketLevel(280)
|
||||
pub const sol_packet = SocketLevel(263)
|
||||
pub const sol_pnpipe = SocketLevel(275)
|
||||
pub const sol_pppol2tp = SocketLevel(273)
|
||||
pub const sol_raw = SocketLevel(255)
|
||||
pub const sol_rds = SocketLevel(276)
|
||||
pub const sol_rxrpc = SocketLevel(272)
|
||||
pub const sol_smc = SocketLevel(286)
|
||||
pub const sol_socket = SocketLevel(1)
|
||||
pub const sol_tipc = SocketLevel(271)
|
||||
pub const sol_tls = SocketLevel(282)
|
||||
pub const sol_vsock = SocketLevel(287)
|
||||
pub const sol_x25 = SocketLevel(262)
|
||||
pub const sol_xdp = SocketLevel(283)
|
||||
pub const so_acceptconn = SocketOption(30)
|
||||
pub const so_attach_bpf = SocketOption(50)
|
||||
pub const so_attach_filter = SocketOption(26)
|
||||
pub const so_attach_reuseport_cbpf = SocketOption(51)
|
||||
pub const so_attach_reuseport_ebpf = SocketOption(52)
|
||||
pub const so_bindtodevice = SocketOption(25)
|
||||
pub const so_bindtoifindex = SocketOption(62)
|
||||
pub const so_bpf_extensions = SocketOption(48)
|
||||
pub const so_broadcast = SocketOption(6)
|
||||
pub const so_bsdcompat = SocketOption(14)
|
||||
pub const so_buf_lock = SocketOption(72)
|
||||
pub const so_busy_poll = SocketOption(46)
|
||||
pub const so_busy_poll_budget = SocketOption(70)
|
||||
pub const so_cnx_advice = SocketOption(53)
|
||||
pub const so_cookie = SocketOption(57)
|
||||
pub const so_debug = SocketOption(1)
|
||||
pub const so_detach_bpf = SocketOption(27)
|
||||
pub const so_detach_filter = SocketOption(27)
|
||||
pub const so_detach_reuseport_bpf = SocketOption(68)
|
||||
pub const so_devmem_dmabuf = SocketOption(79)
|
||||
pub const so_devmem_dontneed = SocketOption(80)
|
||||
pub const so_devmem_linear = SocketOption(78)
|
||||
pub const so_domain = SocketOption(39)
|
||||
pub const so_dontroute = SocketOption(5)
|
||||
pub const so_error = SocketOption(4)
|
||||
pub const so_get_filter = SocketOption(26)
|
||||
pub const so_incoming_cpu = SocketOption(49)
|
||||
pub const so_incoming_napi_id = SocketOption(56)
|
||||
pub const so_inq = SocketOption(84)
|
||||
pub const so_keepalive = SocketOption(9)
|
||||
pub const so_linger = SocketOption(13)
|
||||
pub const so_lock_filter = SocketOption(44)
|
||||
pub const so_mark = SocketOption(36)
|
||||
pub const so_max_pacing_rate = SocketOption(47)
|
||||
pub const so_meminfo = SocketOption(55)
|
||||
pub const so_netns_cookie = SocketOption(71)
|
||||
pub const so_nofcs = SocketOption(43)
|
||||
pub const so_no_check = SocketOption(11)
|
||||
pub const so_oobinline = SocketOption(10)
|
||||
pub const so_passcred = SocketOption(16)
|
||||
pub const so_passpidfd = SocketOption(76)
|
||||
pub const so_passrights = SocketOption(83)
|
||||
pub const so_passsec = SocketOption(34)
|
||||
pub const so_peek_off = SocketOption(42)
|
||||
pub const so_peercred = SocketOption(17)
|
||||
pub const so_peergroups = SocketOption(59)
|
||||
pub const so_peername = SocketOption(28)
|
||||
pub const so_peerpidfd = SocketOption(77)
|
||||
pub const so_peersec = SocketOption(31)
|
||||
pub const so_prefer_busy_poll = SocketOption(69)
|
||||
pub const so_priority = SocketOption(12)
|
||||
pub const so_protocol = SocketOption(38)
|
||||
pub const so_rcvbufforce = SocketOption(33)
|
||||
pub const so_rcvbuf = SocketOption(8)
|
||||
pub const so_rcvlowat = SocketOption(18)
|
||||
pub const so_rcvmark = SocketOption(75)
|
||||
pub const so_rcvpriority = SocketOption(82)
|
||||
pub const so_rcvtimeo = SocketOption(20)
|
||||
pub const so_rcvtimeo_new = SocketOption(66)
|
||||
pub const so_rcvtimeo_old = SocketOption(20)
|
||||
pub const so_reserve_mem = SocketOption(73)
|
||||
pub const so_reuseaddr = SocketOption(2)
|
||||
pub const so_reuseport = SocketOption(15)
|
||||
pub const so_rxq_ovfl = SocketOption(40)
|
||||
pub const so_security_authentication = SocketOption(22)
|
||||
pub const so_security_encryption_network = SocketOption(24)
|
||||
pub const so_security_encryption_transport = SocketOption(23)
|
||||
pub const so_select_err_queue = SocketOption(45)
|
||||
pub const so_sndbufforce = SocketOption(32)
|
||||
pub const so_sndbuf = SocketOption(7)
|
||||
pub const so_sndlowat = SocketOption(19)
|
||||
pub const so_sndtimeo = SocketOption(21)
|
||||
pub const so_sndtimeo_new = SocketOption(67)
|
||||
pub const so_sndtimeo_old = SocketOption(21)
|
||||
pub const so_timestamping = SocketOption(37)
|
||||
pub const so_timestamping_new = SocketOption(65)
|
||||
pub const so_timestamping_old = SocketOption(37)
|
||||
pub const so_timestampns = SocketOption(35)
|
||||
pub const so_timestampns_new = SocketOption(64)
|
||||
pub const so_timestampns_old = SocketOption(35)
|
||||
pub const so_timestamp = SocketOption(29)
|
||||
pub const so_timestamp_new = SocketOption(63)
|
||||
pub const so_timestamp_old = SocketOption(29)
|
||||
pub const so_txrehash = SocketOption(74)
|
||||
pub const so_txtime = SocketOption(61)
|
||||
pub const so_type = SocketOption(3)
|
||||
pub const so_wifi_status = SocketOption(41)
|
||||
pub const so_zerocopy = SocketOption(60)
|
||||
@@ -0,0 +1,100 @@
|
||||
import netio
|
||||
|
||||
fn main() {
|
||||
// We want to bind a server socket to the all available local addresses,
|
||||
// (both IPv4 and IPv6) so collect the address info entries for it.
|
||||
ai := netio.addr_info(
|
||||
service: '1081' // The port number to listen.
|
||||
socktype: netio.sock_stream // Address must support TCP transport.
|
||||
family: netio.af_inet6 // IPv6 support.
|
||||
flags: netio.ai_passive // Passive mode for binding to any address (0.0.0.0, ::).
|
||||
)!
|
||||
|
||||
// Just initialize variables.
|
||||
mut socket := netio.Socket{}
|
||||
mut listen_addr := netio.SocketAddr{}
|
||||
|
||||
// Create socket and bind to the first available address.
|
||||
for a in ai {
|
||||
// Create a socket with advertised parameters.
|
||||
socket = netio.Socket.new(a.family, a.socktype, a.protocol)!
|
||||
|
||||
// Set SO_REUSEADDR enabled. It allows a server to bind to a port that
|
||||
// is still in a `TIME-WAIT` state from a previous connection.
|
||||
// https://en.wikipedia.org/wiki/Transmission_Control_Protocol#Protocol_operation
|
||||
socket.set_option(netio.sol_socket, netio.so_reuseaddr, 1)!
|
||||
|
||||
// Allow connections through IPv4, not only IPv6.
|
||||
socket.set_option(netio.ipproto_ipv6, netio.ipv6_v6only, 0)!
|
||||
|
||||
// Bind socket to the address.
|
||||
socket.bind(a.addr) or {
|
||||
// Close previously created socket on bind error and continue with
|
||||
// the next socket address.
|
||||
socket.close()!
|
||||
continue
|
||||
}
|
||||
// Set listen_addr.
|
||||
listen_addr = a.addr
|
||||
break
|
||||
}
|
||||
|
||||
// If the socket.fd is -1 this means that we does not find any socket address.
|
||||
if socket.fd == -1 {
|
||||
eprintln('Cannot create socket...')
|
||||
exit(1)
|
||||
}
|
||||
|
||||
// Close the server socket on exit.
|
||||
defer {
|
||||
socket.close() or { panic(err) }
|
||||
}
|
||||
|
||||
// Start listening for incoming connections on socket.
|
||||
socket.listen(10) or {
|
||||
eprintln('LISTEN: ${err}')
|
||||
exit(1)
|
||||
}
|
||||
|
||||
println('Listening on ${listen_addr}...')
|
||||
|
||||
// Accept the connection from remote. This is a blocking call.
|
||||
// conn will store the new socket connected to the remote.
|
||||
conn, remote_addr := socket.accept() or {
|
||||
eprintln('ACCEPT: ${err}')
|
||||
exit(1)
|
||||
}
|
||||
|
||||
// Close connection on exit.
|
||||
defer {
|
||||
conn.close() or { panic(err) }
|
||||
}
|
||||
|
||||
// Get remote host and port in numeric format.
|
||||
remote_host, remote_port := netio.name_info(remote_addr,
|
||||
flags: netio.ni_numerichost | netio.ni_numericserv
|
||||
)!
|
||||
|
||||
eprintln('Accpeted connection. Remote address: ${remote_host}, remote port: ${remote_port}')
|
||||
|
||||
// Read 512 bytes of data from socket.
|
||||
mut buf := []u8{len: 512} // Initialize the buffer to store message.
|
||||
// Receive data and write it to the buffer.
|
||||
read := conn.recv(mut buf, 0) or {
|
||||
eprintln('RECV: ${err}')
|
||||
exit(1)
|
||||
}
|
||||
|
||||
// Create a string from buffer without the trailing zeros.
|
||||
msg := unsafe { tos_clone(buf.data) }
|
||||
|
||||
eprintln('Received from client: ${read} bytes, data: ${msg}')
|
||||
|
||||
// Send reply to the client.
|
||||
sent := conn.send(msg.bytes(), 0) or {
|
||||
eprintln('SEND: ${err}')
|
||||
exit(1)
|
||||
}
|
||||
|
||||
eprintln('Sent to the client: ${sent} bytes, data: ${msg}')
|
||||
}
|
||||
@@ -10,7 +10,7 @@ fn main() {
|
||||
}
|
||||
|
||||
// Create the server socket address.
|
||||
server_addr := netio.SocketAddr.new_ipv4([u8(127), 0, 0, 1]!, 1081)
|
||||
server_addr := netio.SocketAddr.new_ipv4([..]u8[127, 0, 0, 1], 1088)
|
||||
|
||||
// Connect socket to the server address.
|
||||
socket.connect(server_addr) or {
|
||||
|
||||
+17
-38
@@ -1,55 +1,31 @@
|
||||
import netio
|
||||
|
||||
fn main() {
|
||||
// We want to bind a server socket to the all available local addresses,
|
||||
// (both IPv4 and IPv6) so collect the address info entries for it.
|
||||
ai := netio.addr_info(
|
||||
service: '1081' // The port number to listen.
|
||||
socktype: netio.sock_stream // Address must support TCP transport.
|
||||
family: netio.af_inet6 // IPv6 support.
|
||||
flags: netio.ai_passive // Passive mode for binding to any address (0.0.0.0, ::).
|
||||
)!
|
||||
// This is only for examples_test.v
|
||||
is_test := '-test' in arguments()
|
||||
|
||||
// Just initialize variables.
|
||||
mut socket := netio.Socket{}
|
||||
mut listen_addr := netio.SocketAddr{}
|
||||
// Create listen address.
|
||||
listen_addr := netio.SocketAddr.new_ipv4([..]u8[127, 0, 0, 1], 1088)
|
||||
|
||||
// Create socket and bind to the first available address.
|
||||
for a in ai {
|
||||
// Create a socket with advertised parameters.
|
||||
socket = netio.Socket.new(a.family, a.socktype, a.protocol)!
|
||||
// Create server socket.
|
||||
socket := netio.Socket.new(netio.af_inet, netio.sock_stream, 0)!
|
||||
|
||||
// Close server socket on exit.
|
||||
defer {
|
||||
socket.close() or { panic(err) }
|
||||
}
|
||||
|
||||
// Set SO_REUSEADDR enabled. It allows a server to bind to a port that
|
||||
// is still in a `TIME-WAIT` state from a previous connection.
|
||||
// https://en.wikipedia.org/wiki/Transmission_Control_Protocol#Protocol_operation
|
||||
socket.set_option(netio.sol_socket, netio.so_reuseaddr, 1)!
|
||||
|
||||
// Allow connections through IPv4, not only IPv6.
|
||||
socket.set_option(netio.ipproto_ipv6, netio.ipv6_v6only, 0)!
|
||||
|
||||
// Bind socket to the address.
|
||||
socket.bind(a.addr) or {
|
||||
// Close previously created socket on bind error and continue with
|
||||
// the next socket address.
|
||||
socket.close()!
|
||||
continue
|
||||
}
|
||||
// Set listen_addr.
|
||||
listen_addr = a.addr
|
||||
break
|
||||
}
|
||||
|
||||
// If the socket.fd is -1 this means that we does not find any socket address.
|
||||
if socket.fd == -1 {
|
||||
eprintln('Cannot create socket...')
|
||||
socket.bind(listen_addr) or {
|
||||
eprintln('BIND: ${err}')
|
||||
exit(1)
|
||||
}
|
||||
|
||||
// Close the server socket on exit.
|
||||
defer {
|
||||
socket.close() or { panic(err) }
|
||||
}
|
||||
|
||||
// Start listening for incoming connections on socket.
|
||||
socket.listen(10) or {
|
||||
eprintln('LISTEN: ${err}')
|
||||
@@ -71,10 +47,13 @@ fn main() {
|
||||
}
|
||||
|
||||
// Get remote host and port in numeric format.
|
||||
remote_host, remote_port := netio.name_info(remote_addr,
|
||||
remote_host, mut remote_port := netio.name_info(remote_addr,
|
||||
flags: netio.ni_numerichost | netio.ni_numericserv
|
||||
)!
|
||||
|
||||
if is_test {
|
||||
remote_port = '1001'
|
||||
}
|
||||
eprintln('Accpeted connection. Remote address: ${remote_host}, remote port: ${remote_port}')
|
||||
|
||||
// Read 512 bytes of data from socket.
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import os
|
||||
import time
|
||||
|
||||
fn run(entrypoint string) os.Result {
|
||||
cmd := 'v -Wfatal-errors -path "${@VMODROOT}/../|@vlib" run ${entrypoint}'
|
||||
return os.execute(cmd)
|
||||
}
|
||||
|
||||
fn test_example_host_fqdn() {
|
||||
r := run('examples/host_fqdn.v')
|
||||
dump(r.output)
|
||||
// host_fqdn may return empty string and this is also fine. So check exit_code only.
|
||||
assert r.exit_code == 0
|
||||
}
|
||||
|
||||
fn test_example_tcp_echo_server() {
|
||||
expect_server := 'Listening on 127.0.0.1:1088...
|
||||
|Accpeted connection. Remote address: 127.0.0.1, remote port: 1001
|
||||
|Received from client: 18 bytes, data: Hello from client!
|
||||
|Sent to the client: 18 bytes, data: Hello from client!'.strip_margin()
|
||||
|
||||
expect_client := 'Connected to server 127.0.0.1:1088...
|
||||
|Sent to the server: 18 bytes, data: Hello from client!
|
||||
|Received from server: 18 bytes, data: Hello from client!'.strip_margin()
|
||||
|
||||
mut threads := []thread os.Result{}
|
||||
threads << spawn run('examples/tcp_echo_server.v -test')
|
||||
time.sleep(time.second * 1)
|
||||
threads << spawn run('examples/tcp_echo_client.v')
|
||||
results := threads.wait()
|
||||
|
||||
// result.output contains the string with lots of trailing zeros, so we
|
||||
// use limit() to shrink the output string to the expected length.
|
||||
for result in results {
|
||||
assert result.exit_code == 0
|
||||
if result.output.contains('Listening') {
|
||||
assert result.output.limit(expect_server.len) == expect_server
|
||||
} else {
|
||||
assert result.output.limit(expect_client.len) == expect_client
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,32 +14,86 @@ fn C.if_indextoname(u32, &char) &char
|
||||
fn C.if_nameindex() &C.if_nameindex
|
||||
fn C.if_freenameindex(voidptr)
|
||||
|
||||
pub struct NetworkInterfaceNotFound {
|
||||
Error
|
||||
pub:
|
||||
index u32
|
||||
name string
|
||||
}
|
||||
|
||||
pub fn (e NetworkInterfaceNotFound) msg() string {
|
||||
if e.index != 0 {
|
||||
return 'network interface with index ${e.index} not found'
|
||||
} else {
|
||||
return 'network interface named `${e.name}` not found'
|
||||
}
|
||||
}
|
||||
|
||||
// name_to_index translates the network interface name to index.
|
||||
// See also if_nametoindex(3).
|
||||
pub fn name_to_index(name string) !u32 {
|
||||
index := C.if_nametoindex(&char(name.str))
|
||||
if index == 0 {
|
||||
return error('${@FN}: no index for `${name}`')
|
||||
err := os.last_error()
|
||||
if err.code() == 19 { // ENODEV
|
||||
return NetworkInterfaceNotFound{
|
||||
name: name
|
||||
}
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return index
|
||||
}
|
||||
|
||||
// index_to_name translates the network interface index to name e.g. 'eth0'.
|
||||
// See also if_indextoname(3).
|
||||
pub fn index_to_name(index u32) !string {
|
||||
name := []u8{len: C.IF_NAMESIZE}
|
||||
ifname := C.if_indextoname(index, name.data)
|
||||
if isnil(ifname) {
|
||||
err := os.last_error()
|
||||
if err.code() == 6 { // ENXIO
|
||||
return NetworkInterfaceNotFound{
|
||||
index: index
|
||||
}
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
return os.last_error()
|
||||
}
|
||||
return unsafe { cstring_to_vstring(ifname) }
|
||||
}
|
||||
|
||||
pub struct NetworkInterface {
|
||||
pub struct NetworkInterfaceId {
|
||||
pub:
|
||||
index u32
|
||||
name string
|
||||
}
|
||||
|
||||
// interfaces returns an array with names and indexes of all network interfaces in system.
|
||||
pub fn interfaces() ![]NetworkInterface {
|
||||
// find_network_interface returns the network interface index and name by provided string s.
|
||||
// If network interface is not present the NetworkInterfaceNotFound error will be returned.
|
||||
// See also `index_to_name()` and `name_to_index()`.
|
||||
// Example: assert netio.find_network_interface('eth0')!.index == 2
|
||||
// Example: assert netio.find_network_interface('2')!.name == 'eth0'
|
||||
pub fn find_network_interface(s string) !NetworkInterfaceId {
|
||||
mut index := u32(0)
|
||||
mut name := ''
|
||||
if s.is_int() {
|
||||
index = s.u32()
|
||||
name = index_to_name(index)!
|
||||
} else {
|
||||
name = s
|
||||
index = name_to_index(name)!
|
||||
}
|
||||
return NetworkInterfaceId{
|
||||
index: index
|
||||
name: name
|
||||
}
|
||||
}
|
||||
|
||||
// network_interfaces returns an array with names and indexes of all network interfaces in system.
|
||||
pub fn network_interfaces() ![]NetworkInterfaceId {
|
||||
ifaces := C.if_nameindex()
|
||||
if isnil(ifaces) {
|
||||
return os.last_error()
|
||||
@@ -47,7 +101,7 @@ pub fn interfaces() ![]NetworkInterface {
|
||||
defer {
|
||||
C.if_freenameindex(ifaces)
|
||||
}
|
||||
mut result := []NetworkInterface{}
|
||||
mut result := []NetworkInterfaceId{}
|
||||
mut i := 0
|
||||
for {
|
||||
iface := unsafe { ifaces[i] }
|
||||
@@ -55,7 +109,7 @@ pub fn interfaces() ![]NetworkInterface {
|
||||
if iface.if_index == 0 && isnil(iface.if_name) {
|
||||
break
|
||||
}
|
||||
result << NetworkInterface{
|
||||
result << NetworkInterfaceId{
|
||||
index: iface.if_index
|
||||
name: unsafe { cstring_to_vstring(iface.if_name) }
|
||||
}
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
import netio
|
||||
|
||||
fn test_interfaces() {
|
||||
ifs := netio.interfaces()!
|
||||
dump(ifs)
|
||||
assert ifs.len > 0
|
||||
}
|
||||
|
||||
fn test_name_to_index() {
|
||||
assert netio.name_to_index('lo')! == 1
|
||||
}
|
||||
@@ -13,3 +7,14 @@ fn test_name_to_index() {
|
||||
fn test_index_to_name() {
|
||||
assert netio.index_to_name(1)! == 'lo'
|
||||
}
|
||||
|
||||
fn test_network_interfaces() {
|
||||
ifs := netio.network_interfaces()!
|
||||
// dump(ifs)
|
||||
assert ifs.len > 0
|
||||
}
|
||||
|
||||
fn test_find_network_interface() {
|
||||
assert netio.find_network_interface('lo')!.name == 'lo'
|
||||
assert netio.find_network_interface('1')!.index == 1
|
||||
}
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
#!/usr/bin/env -S v run
|
||||
|
||||
import os
|
||||
import rand
|
||||
import strings
|
||||
|
||||
/*
|
||||
This is a C bindings generator for netio module.
|
||||
|
||||
This script uses the C preprocessor (`cc`) to extract macros using programs
|
||||
from `cincludes` and generates a V module file with constants.
|
||||
|
||||
The C defines (`#define`) are parsed and used to generate a temporary
|
||||
V program (`vprogram`), which generates the final V module file.
|
||||
|
||||
The goal is for the final V module file to contain only the values of C
|
||||
constants, rather than calling C code directly.
|
||||
*/
|
||||
|
||||
const cincludes = {
|
||||
'Linux': '
|
||||
|#include <netinet/in.h>
|
||||
|#include <sys/socket.h>
|
||||
|#include <netdb.h>'
|
||||
'FreeBSD': '
|
||||
|#include <netinet/in.h>
|
||||
|#include <sys/socket.h>
|
||||
|#include <netdb.h>'
|
||||
}
|
||||
|
||||
const typemap = {
|
||||
'SocketType': ['SOCK_']
|
||||
'SocketLevel': ['SOL_', 'IPPROTO_']
|
||||
'SocketOption': ['SO_', 'IP_', 'IPV6_']
|
||||
'AddrFamily': ['AF_']
|
||||
'AddrInfoFlag': ['AI_']
|
||||
'NameInfoFlag': ['NI_']
|
||||
'MsgFlag': ['MSG_']
|
||||
}
|
||||
|
||||
const vprogram = r'module main
|
||||
|
||||
%includes
|
||||
|
||||
fn main() {
|
||||
// Generate the final .v file
|
||||
println("module netio\n")
|
||||
println("/*")
|
||||
println("\tThis file is generated by make.vsh, DO NOT EDIT.")
|
||||
println("*/\n")
|
||||
for k, v in cdefs {
|
||||
println("pub const ${k} = ${v.vtype}(${v.value})")
|
||||
}
|
||||
}
|
||||
|
||||
struct CDef {
|
||||
vtype string
|
||||
value isize
|
||||
}
|
||||
'
|
||||
|
||||
const cc = 'cc'
|
||||
const cflags = os.getenv('CFLAGS')
|
||||
|
||||
fn main() {
|
||||
cprogram :=
|
||||
cincludes[os.uname().sysname] or { panic('platform is not yet supported') }.strip_margin().trim_space()
|
||||
cc_cmd := "echo '${cprogram}' | ${cc} -x c - -E -dM ${cflags} | sort -k 2 -V"
|
||||
cc_out := os.execute_or_panic(cc_cmd)
|
||||
mut buf := strings.new_builder(1024)
|
||||
buf.writeln(vprogram.replace('%includes', cprogram))
|
||||
buf.writeln('const cdefs = {')
|
||||
for line in cc_out.output.split_into_lines() {
|
||||
for vtype, cdef_prefixes in typemap {
|
||||
for cdef_prefix in cdef_prefixes {
|
||||
if line.starts_with('#define ${cdef_prefix}') {
|
||||
cconst_name := line.fields()[1]
|
||||
if cconst_name.contains('(') {
|
||||
continue // skip non-constant macros
|
||||
}
|
||||
buf.writeln("'${cconst_name.to_lower_ascii()}': CDef{'${vtype}', C.${cconst_name}}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
buf.write_byte(`}`)
|
||||
vfile_path := os.join_path_single(os.temp_dir(), rand.string(10) + '.c.v')
|
||||
os.write_file(vfile_path, buf.str())!
|
||||
os.execute_or_panic('v -Wfatal-errors -W -N ${vfile_path}')
|
||||
os.execute_or_panic('v fmt -w ${vfile_path}')
|
||||
v_out := os.execute_or_panic('${vfile_path.replace('.c.v', '')}')
|
||||
print(v_out.output)
|
||||
flush_stdout()
|
||||
os.rm(vfile_path)!
|
||||
}
|
||||
+29
-22
@@ -24,22 +24,22 @@ mut:
|
||||
pub fn SocketAddr.new_ipv4(addr [4]u8, port u16) SocketAddr {
|
||||
mut sock_addr := unsafe { SocketAddr.new(af_inet, 16) }
|
||||
unsafe {
|
||||
sock_addr.push(binary.big_endian_get_u16(port)) or {}
|
||||
sock_addr.push(addr[..]) or {}
|
||||
sock_addr.write(binary.big_endian_get_u16(port)) or {}
|
||||
sock_addr.write(addr[..]) or {}
|
||||
}
|
||||
return sock_addr
|
||||
}
|
||||
|
||||
// SocketAddr.new_ipv6 creates new AF_INET6 socket address.
|
||||
// addr must be set in network (big-endian) byte order.
|
||||
// Use if_nametoindex(3) to get an integer scope_id from its string representation.
|
||||
// Use `find_network_interface()` to get an integer scope_id from its string representation.
|
||||
pub fn SocketAddr.new_ipv6(addr [16]u8, port u16, flow_info u32, scope_id u32) SocketAddr {
|
||||
mut sock_addr := unsafe { SocketAddr.new(af_inet6, 28) }
|
||||
unsafe {
|
||||
sock_addr.push(binary.big_endian_get_u16(port)) or {}
|
||||
sock_addr.push(binary.big_endian_get_u32(flow_info)) or {}
|
||||
sock_addr.push(addr[..]) or {}
|
||||
sock_addr.push(binary.big_endian_get_u32(scope_id)) or {}
|
||||
sock_addr.write(binary.big_endian_get_u16(port)) or {}
|
||||
sock_addr.write(binary.big_endian_get_u32(flow_info)) or {}
|
||||
sock_addr.write(addr[..]) or {}
|
||||
sock_addr.write(binary.big_endian_get_u32(scope_id)) or {}
|
||||
}
|
||||
return sock_addr
|
||||
}
|
||||
@@ -52,7 +52,7 @@ pub fn SocketAddr.new_unix(path string) !SocketAddr {
|
||||
}
|
||||
mut sock_addr := unsafe { SocketAddr.new(af_unix, usize(max_unix_path_len) + 2) }
|
||||
unsafe {
|
||||
sock_addr.push(path.bytes()) or {}
|
||||
sock_addr.write(path.bytes()) or {}
|
||||
}
|
||||
return sock_addr
|
||||
}
|
||||
@@ -65,7 +65,7 @@ pub fn SocketAddr.new_unix(path string) !SocketAddr {
|
||||
//
|
||||
// SocketAddr is a builder for
|
||||
// [sockaddr(3type)](https://www.man7.org/linux/man-pages/man3/sockaddr.3type.html) objects.
|
||||
// Use this function only if you understand what you do. Using the `push()` method you must
|
||||
// Use this function only if you understand what you do. Using the `write()` method you must
|
||||
// write the data for the desired socket address, ensuring the correct sizes of all types,
|
||||
// the order of the fields in the struct, the byte order, and the total size of the struct.
|
||||
// The sizes and byte order may vary by platform, so you'll need to keep an eye on that as
|
||||
@@ -102,8 +102,8 @@ pub fn SocketAddr.new_unix(path string) !SocketAddr {
|
||||
//
|
||||
// mut sa := unsafe { netio.SocketAddr.new(netio.af_inet, 16) }
|
||||
// unsafe {
|
||||
// sa.push(binary.big_endian_get_u16(u16(1080)))!
|
||||
// sa.push([u8(127), 0, 0, 1])!
|
||||
// sa.write(binary.big_endian_get_u16(u16(1080)))!
|
||||
// sa.write([u8(127), 0, 0, 1])!
|
||||
// }
|
||||
// println(sa)
|
||||
// ```
|
||||
@@ -116,9 +116,9 @@ pub fn SocketAddr.new(af AddrFamily, size isize) SocketAddr {
|
||||
}
|
||||
unsafe {
|
||||
$if little_endian {
|
||||
sock_addr.push(binary.little_endian_get_u16(u16(af))) or {}
|
||||
sock_addr.write(binary.little_endian_get_u16(u16(af))) or {}
|
||||
} $else {
|
||||
sock_addr.push(binary.big_endian_get_u16(u16(af))) or {}
|
||||
sock_addr.write(binary.big_endian_get_u16(u16(af))) or {}
|
||||
}
|
||||
}
|
||||
return sock_addr
|
||||
@@ -170,32 +170,39 @@ pub fn (a SocketAddr) is_empty() bool {
|
||||
if isnil(a.data) {
|
||||
return true
|
||||
}
|
||||
if a.u8_array().all(|e| e == 0) {
|
||||
return true
|
||||
}
|
||||
for i := 0; i < a.len; i++ {
|
||||
if unsafe { a.data[i] } != 0 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// push appends the `inp` bytes into internal data buffer.
|
||||
// write writes `buf.len` bytes of data to the socket address memory area
|
||||
// and returns the number of bytes written.
|
||||
// write will return an error if the socket address pointer is nil or
|
||||
// the buffer length, including the length of the data already written,
|
||||
// exceeds the size of the socket address.
|
||||
@[unsafe]
|
||||
pub fn (mut a SocketAddr) push(inp []u8) ! {
|
||||
pub fn (mut a SocketAddr) write(buf []u8) !int {
|
||||
if isnil(a.data) {
|
||||
return error('${@METHOD}: SocketAddr is nil')
|
||||
}
|
||||
if a.pos + inp.len > a.len {
|
||||
if a.pos + buf.len > a.len {
|
||||
return error('${@METHOD}: data overflow')
|
||||
}
|
||||
mut i := 0
|
||||
for a.pos + 1 < a.len {
|
||||
unsafe {
|
||||
a.data[a.pos + i] = inp[i]
|
||||
a.data[a.pos + i] = buf[i]
|
||||
}
|
||||
i++
|
||||
if i >= inp.len {
|
||||
if i >= buf.len {
|
||||
break
|
||||
}
|
||||
}
|
||||
a.pos += inp.len
|
||||
a.pos += i
|
||||
return i
|
||||
}
|
||||
|
||||
// ptr returns the pointer to sockaddr data.
|
||||
|
||||
+9
-3
@@ -1,17 +1,23 @@
|
||||
import netio
|
||||
|
||||
fn test_socket_addr_ipv4() {
|
||||
fn test_socket_addr_new_ipv4() {
|
||||
addr := netio.SocketAddr.new_ipv4([u8(127), 0, 0, 1]!, 1080)
|
||||
assert addr.str() == '127.0.0.1:1080'
|
||||
}
|
||||
|
||||
fn test_socket_addr_ipv6() {
|
||||
fn test_socket_addr_new_ipv6() {
|
||||
addr := netio.SocketAddr.new_ipv6([u8(0xfd), 0xf1, 0x72, 0xd1, 0x00, 0x33, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x47]!, 25535, 0, 0)
|
||||
assert addr.str() == '[fdf1:72d1:0033:0000:0000:0000:0000:0247]:25535'
|
||||
}
|
||||
|
||||
fn test_socket_addr_unix() {
|
||||
fn test_socket_addr_new_unix() {
|
||||
addr := netio.SocketAddr.new_unix('/run/app.sock')!
|
||||
assert addr.str() == '/run/app.sock'
|
||||
}
|
||||
|
||||
fn test_socket_addr_is_empty() {
|
||||
assert unsafe { netio.SocketAddr.new(netio.af_unspec, 16).is_empty() }
|
||||
assert netio.SocketAddr{}.is_empty()
|
||||
assert !netio.SocketAddr.new_ipv4([u8(127), 0, 0, 1]!, 16).is_empty()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user