Skip to content

unix netinet in

IsaacShelton edited this page Nov 13, 2022 · 4 revisions

unix/netinet/in

[unix/netinet/in.adept](https://github.com/AdeptLanguage/AdeptImport/blob/2eb8b9e05864f782fc7b75b5e62346c5643b8b72/in.h>`.

Type Aliases

alias in6_addr_t = in6_addr

Structures

struct in_addr (s_addr in_addr_t)

struct sockaddr_in (sin_len ubyte, sin_family sa_family_t, sin_port in_port_t, sin_addr in_addr, sin_zero 8 ubyte)

struct in6_addr (__u6_addr8 16 ubyte, __u6_addr16 8 ushort, __u6_addr32 4 uint)

struct ipv6_mreq (ipv6mr_multiaddr in6_addr, ipv6mr_interface uint)

Functions

  • func IN_CLASSA(i uint) bool
  • func IN_CLASSB(i uint) bool
  • func IN_CLASSC(i uint) bool
  • func IN_CLASSD(i uint) bool
  • func IN_MULTICAST(i uint) bool
  • func IN_EXPERIMENTAL(i uint) bool
  • func IN_BADCLASS(i uint) bool
  • func IN6ADDR_ANY_INIT() in6_addr
  • func IN6ADDR_LOOPBACK_INIT() in6_addr
  • func IN6_IS_ADDR_UNSPECIFIED(a *in6_addr) bool
  • func IN6_IS_ADDR_LOOPBACK(a *in6_addr) bool
  • func IN6_IS_ADDR_MULTICAST(a *in6_addr) bool
  • func IN6_IS_ADDR_LINKLOCAL(a *in6_addr) bool
  • func IN6_IS_ADDR_SITELOCAL(a *in6_addr) bool
  • func IN6_IS_ADDR_V4MAPPED(a *in6_addr) bool
  • func IN6_IS_ADDR_V4COMPAT(a *in6_addr) bool
  • func __IPV6_ADDR_MC_SCOPE(a *in6_addr) ubyte
  • func IN6_IS_ADDR_MC_NODELOCAL(a *in6_addr) bool
  • func IN6_IS_ADDR_MC_LINKLOCAL(a *in6_addr) bool
  • func IN6_IS_ADDR_MC_SITELOCAL(a *in6_addr) bool
  • func IN6_IS_ADDR_MC_ORGLOCAL(a *in6_addr) bool
  • func IN6_IS_ADDR_MC_GLOBAL(a *in6_addr) bool

Constants

define IPPROTO_IP = 0
define     IPPROTO_HOPOPTS = 0
define IPPROTO_ICMP = 1
define     IPPROTO_IGMP = 2
define     IPPROTO_GGP  = 3
define     IPPROTO_IPV4 = 4
define     IPPROTO_IPIP = IPPROTO_IPV4
define IPPROTO_TCP = 6
define     IPPROTO_ST     = 7
define     IPPROTO_EGP    = 8
define     IPPROTO_PIGP   = 9
define     IPPROTO_RCCMON = 10
define     IPPROTO_NVPII  = 11
define     IPPROTO_PUP    = 12
define     IPPROTO_ARGUS  = 13
define     IPPROTO_EMCON  = 14
define     IPPROTO_XNET   = 15
define     IPPROTO_CHAOS  = 16
define IPPROTO_UDP = 17
define     IPPROTO_MUX     = 18
define     IPPROTO_MEAS    = 19
define     IPPROTO_HMP     = 20
define     IPPROTO_PRM     = 21
define     IPPROTO_IDP     = 22
define     IPPROTO_TRUNK1  = 23
define     IPPROTO_TRUNK2  = 24
define     IPPROTO_LEAF1   = 25
define     IPPROTO_LEAF2   = 26
define     IPPROTO_RDP     = 27
define     IPPROTO_IRTP    = 28
define     IPPROTO_TP      = 29
define     IPPROTO_BLT     = 30
define     IPPROTO_NSP     = 31
define     IPPROTO_INP     = 32
define     IPPROTO_SEP     = 33
define     IPPROTO_3PC     = 34
define     IPPROTO_IDPR    = 35
define     IPPROTO_XTP     = 36
define     IPPROTO_DDP     = 37
define     IPPROTO_CMTP    = 38
define     IPPROTO_TPXX    = 39
define     IPPROTO_IL      = 40
define IPPROTO_IPV6 = 41
define     IPPROTO_SDRP      = 42        
define     IPPROTO_ROUTING   = 43        
define     IPPROTO_FRAGMENT  = 44
define     IPPROTO_IDRP      = 45        
define     IPPROTO_RSVP      = 46
define     IPPROTO_GRE       = 47        
define     IPPROTO_MHRP      = 48        
define     IPPROTO_BHA       = 49        
define     IPPROTO_ESP       = 50        
define     IPPROTO_AH        = 51        
define     IPPROTO_INLSP     = 52        
define     IPPROTO_SWIPE     = 53        
define     IPPROTO_NHRP      = 54        
define     IPPROTO_ICMPV6    = 58        
define     IPPROTO_NONE      = 59        
define     IPPROTO_DSTOPTS   = 60        
define     IPPROTO_AHIP      = 61        
define     IPPROTO_CFTP      = 62        
define     IPPROTO_HELLO     = 63        
define     IPPROTO_SATEXPAK  = 64        
define     IPPROTO_KRYPTOLAN = 65
define     IPPROTO_RVD       = 66
define     IPPROTO_IPPC      = 67
define     IPPROTO_ADFS      = 68
define     IPPROTO_SATMON    = 69
define     IPPROTO_VISA      = 70
define     IPPROTO_IPCV      = 71
define     IPPROTO_CPNX      = 72
define     IPPROTO_CPHB      = 73
define     IPPROTO_WSN       = 74
define     IPPROTO_PVP       = 75
define     IPPROTO_BRSATMON  = 76
define     IPPROTO_ND        = 77
define     IPPROTO_WBMON     = 78
define     IPPROTO_WBEXPAK   = 79
define     IPPROTO_EON       = 80
define     IPPROTO_VMTP      = 81
define     IPPROTO_SVMTP     = 82
define     IPPROTO_VINES     = 83
define     IPPROTO_TTP       = 84
define     IPPROTO_IGP       = 85
define     IPPROTO_DGP       = 86
define     IPPROTO_TCF       = 87
define     IPPROTO_IGRP      = 88
define     IPPROTO_OSPFIGP   = 89
define     IPPROTO_SRPC      = 90
define     IPPROTO_LARP      = 91
define     IPPROTO_MTP       = 92
define     IPPROTO_AX25      = 93
define     IPPROTO_IPEIP     = 94
define     IPPROTO_MICP      = 95
define     IPPROTO_SCCSP     = 96
define     IPPROTO_ETHERIP   = 97
define     IPPROTO_ENCAP     = 98
define     IPPROTO_APES      = 99
define     IPPROTO_GMTP      = 100
define     IPPROTO_PIM       = 103
define     IPPROTO_IPCOMP    = 108
define     IPPROTO_PGM       = 113
define     IPPROTO_SCTP      = 132
define     IPPROTO_DIVERT    = 254
define IPPROTO_RAW = 255
define     IPPROTO_MAX = 256
define     IPPROTO_DONE = 257
define INADDR_ANY       = 0x00000000
define INADDR_BROADCAST = 0xffffffff
define IN_CLASSA_NET    = 0xff000000
define IN_CLASSA_NSHIFT = 24
define IN_CLASSA_HOST   = 0x00ffffff
define IN_CLASSA_MAX    = 128
define IN_CLASSB_NET    = 0xffff0000
define IN_CLASSB_NSHIFT = 16
define IN_CLASSB_HOST   = 0x0000ffff
define IN_CLASSB_MAX    = 65536
define IN_CLASSC_NET    = 0xffffff00
define IN_CLASSC_NSHIFT = 8
define IN_CLASSC_HOST   = 0x000000ff
define IN_CLASSD_NET    = 0xf0000000
define IN_CLASSD_NSHIFT = 28
define IN_CLASSD_HOST   = 0x0fffffff
define INADDR_LOOPBACK = 0x7f000001
define INADDR_UNSPEC_GROUP    = 0xe0000000 // 224.0.0.0
define INADDR_ALLHOSTS_GROUP  = 0xe0000001 // 224.0.0.1
define INADDR_ALLRTRS_GROUP   = 0xe0000002 // 224.0.0.2
define INADDR_ALLRPTS_GROUP   = 0xe0000016 // 224.0.0.22, IGMPv3
define INADDR_CARP_GROUP      = 0xe0000012 // 224.0.0.18
define INADDR_PFSYNC_GROUP    = 0xe00000f0 // 224.0.0.240
define INADDR_ALLMDNS_GROUP   = 0xe00000fb // 224.0.0.251
define INADDR_MAX_LOCAL_GROUP = 0xe00000ff // 224.0.0.255
define IN_LOOPBACKNET = 127
define INET_ADDRSTRLEN  = 16
define INET6_ADDRSTRLEN = 46
define MAX_IPv4_STR_LEN = 16
define MAX_IPv6_STR_LEN = 64
define IPV6_UNICAST_HOPS   = 4
define IPV6_MULTICAST_IF   = 9
define IPV6_MULTICAST_HOPS = 10
define IPV6_MULTICAST_LOOP = 11
define IPV6_JOIN_GROUP     = 12
define IPV6_LEAVE_GROUP    = 13
define IPV6_V6ONLY         = 27
define __IPV6_ADDR_SCOPE_NODELOCAL    = 0x01
define __IPV6_ADDR_SCOPE_INTFACELOCAL = 0x01
define __IPV6_ADDR_SCOPE_LINKLOCAL    = 0x02
define __IPV6_ADDR_SCOPE_SITELOCAL    = 0x05
define __IPV6_ADDR_SCOPE_ORGLOCAL     = 0x08
define __IPV6_ADDR_SCOPE_GLOBAL       = 0x0e

Global Variables

external in6addr_any in6_addr
external in6addr_loopback in6_addr

MacOS-only Definitions

#if __macos__
    IN_LINKLOCALNETNUM == 0xA9FE0000 // 169.254.0.0
    
    func IN_LINKLOCAL(i uint) bool   = /* implementation */
    func IN_LOOPBACK(i uint) bool    = /* implementation */
    func IN_ZERONET(i uint) bool     = /* implementation */
    func IN_PRIVATE(i uint) bool     = /* implementation */
    func IN_LOCAL_GROUP(i uint) bool = /* implementation */
    func IN_ANY_LOCAL(i uint) bool   = /* implementation */
#end

Imported Files

import 'unix/in_port_t.adept'
import 'unix/in_addr_t.adept'
import 'unix/sys/socket.adept'
import 'machine/endian.adept'
Clone this wiki locally