Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 17.49 KB | None | 0 0
  1.  
  2. #ifndef _NETINET_IN_H
  3. #define _NETINET_IN_H   1
  4.  
  5. #include <features.h>
  6. #include <stdint.h>
  7. #include <sys/socket.h>
  8. #include <bits/types.h>
  9.  
  10.  
  11. __BEGIN_DECLS
  12.  
  13. /* Standard well-defined IP protocols.  */
  14. enum
  15.   {
  16.     IPPROTO_IP = 0,    /* Dummy protocol for TCP.  */
  17. #define IPPROTO_IP      IPPROTO_IP
  18.     IPPROTO_HOPOPTS = 0,   /* IPv6 Hop-by-Hop options.  */
  19. #define IPPROTO_HOPOPTS     IPPROTO_HOPOPTS
  20.     IPPROTO_ICMP = 1,      /* Internet Control Message Protocol.  */
  21. #define IPPROTO_ICMP        IPPROTO_ICMP
  22.     IPPROTO_IGMP = 2,      /* Internet Group Management Protocol. */
  23. #define IPPROTO_IGMP        IPPROTO_IGMP
  24.     IPPROTO_IPIP = 4,      /* IPIP tunnels (older KA9Q tunnels use 94).  */
  25. #define IPPROTO_IPIP        IPPROTO_IPIP
  26.     IPPROTO_TCP = 6,       /* Transmission Control Protocol.  */
  27. #define IPPROTO_TCP     IPPROTO_TCP
  28.     IPPROTO_EGP = 8,       /* Exterior Gateway Protocol.  */
  29. #define IPPROTO_EGP     IPPROTO_EGP
  30.     IPPROTO_PUP = 12,      /* PUP protocol.  */
  31. #define IPPROTO_PUP     IPPROTO_PUP
  32.     IPPROTO_UDP = 17,      /* User Datagram Protocol.  */
  33. #define IPPROTO_UDP     IPPROTO_UDP
  34.     IPPROTO_IDP = 22,      /* XNS IDP protocol.  */
  35. #define IPPROTO_IDP     IPPROTO_IDP
  36.     IPPROTO_TP = 29,       /* SO Transport Protocol Class 4.  */
  37. #define IPPROTO_TP      IPPROTO_TP
  38.     IPPROTO_IPV6 = 41,     /* IPv6 header.  */
  39. #define IPPROTO_IPV6        IPPROTO_IPV6
  40.     IPPROTO_ROUTING = 43,  /* IPv6 routing header.  */
  41. #define IPPROTO_ROUTING     IPPROTO_ROUTING
  42.     IPPROTO_FRAGMENT = 44, /* IPv6 fragmentation header.  */
  43. #define IPPROTO_FRAGMENT    IPPROTO_FRAGMENT
  44.     IPPROTO_RSVP = 46,     /* Reservation Protocol.  */
  45. #define IPPROTO_RSVP        IPPROTO_RSVP
  46.     IPPROTO_GRE = 47,      /* General Routing Encapsulation.  */
  47. #define IPPROTO_GRE     IPPROTO_GRE
  48.     IPPROTO_ESP = 50,      /* encapsulating security payload.  */
  49. #define IPPROTO_ESP     IPPROTO_ESP
  50.     IPPROTO_AH = 51,       /* authentication header.  */
  51. #define IPPROTO_AH      IPPROTO_AH
  52.     IPPROTO_ICMPV6 = 58,   /* ICMPv6.  */
  53. #define IPPROTO_ICMPV6      IPPROTO_ICMPV6
  54.     IPPROTO_NONE = 59,     /* IPv6 no next header.  */
  55. #define IPPROTO_NONE        IPPROTO_NONE
  56.     IPPROTO_DSTOPTS = 60,  /* IPv6 destination options.  */
  57. #define IPPROTO_DSTOPTS     IPPROTO_DSTOPTS
  58.     IPPROTO_MTP = 92,      /* Multicast Transport Protocol.  */
  59. #define IPPROTO_MTP     IPPROTO_MTP
  60.     IPPROTO_ENCAP = 98,    /* Encapsulation Header.  */
  61. #define IPPROTO_ENCAP       IPPROTO_ENCAP
  62.     IPPROTO_PIM = 103,     /* Protocol Independent Multicast.  */
  63. #define IPPROTO_PIM     IPPROTO_PIM
  64.     IPPROTO_COMP = 108,    /* Compression Header Protocol.  */
  65. #define IPPROTO_COMP        IPPROTO_COMP
  66.     IPPROTO_SCTP = 132,    /* Stream Control Transmission Protocol.  */
  67. #define IPPROTO_SCTP        IPPROTO_SCTP
  68.     IPPROTO_RAW = 255,     /* Raw IP packets.  */
  69. #define IPPROTO_RAW     IPPROTO_RAW
  70.     IPPROTO_MAX
  71.   };
  72.  
  73.  
  74. /* Type to represent a port.  */
  75. typedef uint16_t in_port_t;
  76.  
  77. /* Standard well-known ports.  */
  78. enum
  79.   {
  80.     IPPORT_ECHO = 7,        /* Echo service.  */
  81.     IPPORT_DISCARD = 9,     /* Discard transmissions service.  */
  82.     IPPORT_SYSTAT = 11,     /* System status service.  */
  83.     IPPORT_DAYTIME = 13,    /* Time of day service.  */
  84.     IPPORT_NETSTAT = 15,    /* Network status service.  */
  85.     IPPORT_FTP = 21,        /* File Transfer Protocol.  */
  86.     IPPORT_TELNET = 23,     /* Telnet protocol.  */
  87.     IPPORT_SMTP = 25,       /* Simple Mail Transfer Protocol.  */
  88.     IPPORT_TIMESERVER = 37, /* Timeserver service.  */
  89.     IPPORT_NAMESERVER = 42, /* Domain Name Service.  */
  90.     IPPORT_WHOIS = 43,      /* Internet Whois service.  */
  91.     IPPORT_MTP = 57,
  92.  
  93.     IPPORT_TFTP = 69,       /* Trivial File Transfer Protocol.  */
  94.     IPPORT_RJE = 77,
  95.     IPPORT_FINGER = 79,     /* Finger service.  */
  96.     IPPORT_TTYLINK = 87,
  97.     IPPORT_SUPDUP = 95,     /* SUPDUP protocol.  */
  98.  
  99.  
  100.     IPPORT_EXECSERVER = 512,    /* execd service.  */
  101.     IPPORT_LOGINSERVER = 513,   /* rlogind service.  */
  102.     IPPORT_CMDSERVER = 514,
  103.     IPPORT_EFSSERVER = 520,
  104.  
  105.     /* UDP ports.  */
  106.     IPPORT_BIFFUDP = 512,
  107.     IPPORT_WHOSERVER = 513,
  108.     IPPORT_ROUTESERVER = 520,
  109.  
  110.     /* Ports less than this value are reserved for privileged processes.  */
  111.     IPPORT_RESERVED = 1024,
  112.  
  113.     /* Ports greater this value are reserved for (non-privileged) servers.  */
  114.     IPPORT_USERRESERVED = 5000
  115.   };
  116.  
  117.  
  118. /* Internet address.  */
  119. typedef uint32_t in_addr_t;
  120. struct in_addr
  121.   {
  122.     in_addr_t s_addr;
  123.   };
  124.  
  125.  
  126. /* Definitions of the bits in an Internet address integer.
  127.  
  128.    On subnets, host and network parts are found according to
  129.    the subnet mask, not these masks.  */
  130.  
  131. #define IN_CLASSA(a)        ((((in_addr_t)(a)) & 0x80000000) == 0)
  132. #define IN_CLASSA_NET       0xff000000
  133. #define IN_CLASSA_NSHIFT    24
  134. #define IN_CLASSA_HOST      (0xffffffff & ~IN_CLASSA_NET)
  135. #define IN_CLASSA_MAX       128
  136.  
  137. #define IN_CLASSB(a)        ((((in_addr_t)(a)) & 0xc0000000) == 0x80000000)
  138. #define IN_CLASSB_NET       0xffff0000
  139. #define IN_CLASSB_NSHIFT    16
  140. #define IN_CLASSB_HOST      (0xffffffff & ~IN_CLASSB_NET)
  141. #define IN_CLASSB_MAX       65536
  142.  
  143. #define IN_CLASSC(a)        ((((in_addr_t)(a)) & 0xe0000000) == 0xc0000000)
  144. #define IN_CLASSC_NET       0xffffff00
  145. #define IN_CLASSC_NSHIFT    8
  146. #define IN_CLASSC_HOST      (0xffffffff & ~IN_CLASSC_NET)
  147.  
  148. #define IN_CLASSD(a)        ((((in_addr_t)(a)) & 0xf0000000) == 0xe0000000)
  149. #define IN_MULTICAST(a)     IN_CLASSD(a)
  150.  
  151. #define IN_EXPERIMENTAL(a)  ((((in_addr_t)(a)) & 0xe0000000) == 0xe0000000)
  152. #define IN_BADCLASS(a)      ((((in_addr_t)(a)) & 0xf0000000) == 0xf0000000)
  153.  
  154. /* Address to accept any incoming messages.  */
  155. #define INADDR_ANY      ((in_addr_t) 0x00000000)
  156. /* Address to send to all hosts.  */
  157. #define INADDR_BROADCAST    ((in_addr_t) 0xffffffff)
  158. /* Address indicating an error return.  */
  159. #define INADDR_NONE     ((in_addr_t) 0xffffffff)
  160.  
  161. /* Network number for local host loopback.  */
  162. #define IN_LOOPBACKNET      127
  163. /* Address to loopback in software to local host.  */
  164. #ifndef INADDR_LOOPBACK
  165. # define INADDR_LOOPBACK    ((in_addr_t) 0x7f000001) /* Inet 127.0.0.1.  */
  166. #endif
  167.  
  168. /* Defines for Multicast INADDR.  */
  169. #define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000) /* 224.0.0.0 */
  170. #define INADDR_ALLHOSTS_GROUP   ((in_addr_t) 0xe0000001) /* 224.0.0.1 */
  171. #define INADDR_ALLRTRS_GROUP    ((in_addr_t) 0xe0000002) /* 224.0.0.2 */
  172. #define INADDR_MAX_LOCAL_GROUP  ((in_addr_t) 0xe00000ff) /* 224.0.0.255 */
  173.  
  174.  
  175. /* IPv6 address */
  176. struct in6_addr
  177.   {
  178.     union
  179.       {
  180.     uint8_t u6_addr8[16];
  181.     uint16_t u6_addr16[8];
  182.     uint32_t u6_addr32[4];
  183.       } in6_u;
  184. #define s6_addr         in6_u.u6_addr8
  185. #define s6_addr16       in6_u.u6_addr16
  186. #define s6_addr32       in6_u.u6_addr32
  187.   };
  188.  
  189. extern const struct in6_addr in6addr_any;        /* :: */
  190. extern const struct in6_addr in6addr_loopback;   /* ::1 */
  191. #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
  192. #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
  193.  
  194. #define INET_ADDRSTRLEN 16
  195. #define INET6_ADDRSTRLEN 46
  196.  
  197. /* Get the definition of the macro to define the common sockaddr members.  */
  198. #include <bits/socket.h>
  199.  
  200.  
  201. /* Structure describing an Internet socket address.  */
  202. struct sockaddr_in
  203.   {
  204.     __SOCKADDR_COMMON (sin_);
  205.     in_port_t sin_port;         /* Port number.  */
  206.     struct in_addr sin_addr;        /* Internet address.  */
  207.  
  208.     /* Pad to size of `struct sockaddr'.  */
  209.     unsigned char sin_zero[sizeof (struct sockaddr) -
  210.                __SOCKADDR_COMMON_SIZE -
  211.                sizeof (in_port_t) -
  212.                sizeof (struct in_addr)];
  213.   };
  214.  
  215. /* Ditto, for IPv6.  */
  216. struct sockaddr_in6
  217.   {
  218.     __SOCKADDR_COMMON (sin6_);
  219.     in_port_t sin6_port;    /* Transport layer port # */
  220.     uint32_t sin6_flowinfo; /* IPv6 flow information */
  221.     struct in6_addr sin6_addr;  /* IPv6 address */
  222.     uint32_t sin6_scope_id; /* IPv6 scope-id */
  223.   };
  224.  
  225.  
  226. /* IPv4 multicast request.  */
  227. struct ip_mreq
  228.   {
  229.     /* IP multicast address of group.  */
  230.     struct in_addr imr_multiaddr;
  231.  
  232.     /* Local IP address of interface.  */
  233.     struct in_addr imr_interface;
  234.   };
  235.  
  236. struct ip_mreq_source
  237.   {
  238.     /* IP multicast address of group.  */
  239.     struct in_addr imr_multiaddr;
  240.  
  241.     /* IP address of source.  */
  242.     struct in_addr imr_interface;
  243.  
  244.     /* IP address of interface.  */
  245.     struct in_addr imr_sourceaddr;
  246.   };
  247.  
  248. /* Likewise, for IPv6.  */
  249. struct ipv6_mreq
  250.   {
  251.     /* IPv6 multicast address of group */
  252.     struct in6_addr ipv6mr_multiaddr;
  253.  
  254.     /* local interface */
  255.     unsigned int ipv6mr_interface;
  256.   };
  257.  
  258.  
  259. /* Multicast group request.  */
  260. struct group_req
  261.   {
  262.     /* Interface index.  */
  263.     uint32_t gr_interface;
  264.  
  265.     /* Group address.  */
  266.     struct sockaddr_storage gr_group;
  267.   };
  268.  
  269. struct group_source_req
  270.   {
  271.     /* Interface index.  */
  272.     uint32_t gsr_interface;
  273.  
  274.     /* Group address.  */
  275.     struct sockaddr_storage gsr_group;
  276.  
  277.     /* Source address.  */
  278.     struct sockaddr_storage gsr_source;
  279.   };
  280.  
  281.  
  282. /* Full-state filter operations.  */
  283. struct ip_msfilter
  284.   {
  285.     /* IP multicast address of group.  */
  286.     struct in_addr imsf_multiaddr;
  287.  
  288.     /* Local IP address of interface.  */
  289.     struct in_addr imsf_interface;
  290.  
  291.     /* Filter mode.  */
  292.     uint32_t imsf_fmode;
  293.  
  294.     /* Number of source addresses.  */
  295.     uint32_t imsf_numsrc;
  296.     /* Source addresses.  */
  297.     struct in_addr imsf_slist[1];
  298.   };
  299.  
  300. #define IP_MSFILTER_SIZE(numsrc) (sizeof (struct ip_msfilter) \
  301.                   - sizeof (struct in_addr)           \
  302.                   + (numsrc) * sizeof (struct in_addr))
  303.  
  304. struct group_filter
  305.   {
  306.     /* Interface index.  */
  307.     uint32_t gf_interface;
  308.  
  309.     /* Group address.  */
  310.     struct sockaddr_storage gf_group;
  311.  
  312.     /* Filter mode.  */
  313.     uint32_t gf_fmode;
  314.  
  315.     /* Number of source addresses.  */
  316.     uint32_t gf_numsrc;
  317.     /* Source addresses.  */
  318.     struct sockaddr_storage gf_slist[1];
  319. };
  320.  
  321. #define GROUP_FILTER_SIZE(numsrc) (sizeof (struct group_filter) \
  322.                    - sizeof (struct sockaddr_storage)         \
  323.                    + ((numsrc)                    \
  324.                       * sizeof (struct sockaddr_storage)))
  325.  
  326.  
  327. /* Get system-specific definitions.  */
  328. #include <bits/in.h>
  329.  
  330. /* Functions to convert between host and network byte order.
  331.  
  332.    Please note that these functions normally take `unsigned long int' or
  333.    `unsigned short int' values as arguments and also return them.  But
  334.    this was a short-sighted decision since on different systems the types
  335.    may have different representations but the values are always the same.  */
  336.  
  337. extern uint32_t ntohl (uint32_t __netlong) __THROW __attribute__ ((__const__));
  338. extern uint16_t ntohs (uint16_t __netshort)
  339.      __THROW __attribute__ ((__const__));
  340. extern uint32_t htonl (uint32_t __hostlong)
  341.      __THROW __attribute__ ((__const__));
  342. extern uint16_t htons (uint16_t __hostshort)
  343.      __THROW __attribute__ ((__const__));
  344.  
  345. #include <endian.h>
  346.  
  347. /* Get machine dependent optimized versions of byte swapping functions.  */
  348. #include <bits/byteswap.h>
  349.  
  350. #ifdef __OPTIMIZE__
  351. /* We can optimize calls to the conversion functions.  Either nothing has
  352.    to be done or we are using directly the byte-swapping functions which
  353.    often can be inlined.  */
  354. # if __BYTE_ORDER == __BIG_ENDIAN
  355. /* The host byte order is the same as network byte order,
  356.    so these functions are all just identity.  */
  357. # define ntohl(x)   (x)
  358. # define ntohs(x)   (x)
  359. # define htonl(x)   (x)
  360. # define htons(x)   (x)
  361. # else
  362. #  if __BYTE_ORDER == __LITTLE_ENDIAN
  363. #   define ntohl(x) __bswap_32 (x)
  364. #   define ntohs(x) __bswap_16 (x)
  365. #   define htonl(x) __bswap_32 (x)
  366. #   define htons(x) __bswap_16 (x)
  367. #  endif
  368. # endif
  369. #endif
  370.  
  371. #define IN6_IS_ADDR_UNSPECIFIED(a) \
  372.     (((__const uint32_t *) (a))[0] == 0                   \
  373.      && ((__const uint32_t *) (a))[1] == 0                    \
  374.      && ((__const uint32_t *) (a))[2] == 0                    \
  375.      && ((__const uint32_t *) (a))[3] == 0)
  376.  
  377. #define IN6_IS_ADDR_LOOPBACK(a) \
  378.     (((__const uint32_t *) (a))[0] == 0                   \
  379.      && ((__const uint32_t *) (a))[1] == 0                    \
  380.      && ((__const uint32_t *) (a))[2] == 0                    \
  381.      && ((__const uint32_t *) (a))[3] == htonl (1))
  382.  
  383. #define IN6_IS_ADDR_MULTICAST(a) (((__const uint8_t *) (a))[0] == 0xff)
  384.  
  385. #define IN6_IS_ADDR_LINKLOCAL(a) \
  386.     ((((__const uint32_t *) (a))[0] & htonl (0xffc00000))             \
  387.      == htonl (0xfe800000))
  388.  
  389. #define IN6_IS_ADDR_SITELOCAL(a) \
  390.     ((((__const uint32_t *) (a))[0] & htonl (0xffc00000))             \
  391.      == htonl (0xfec00000))
  392.  
  393. #define IN6_IS_ADDR_V4MAPPED(a) \
  394.     ((((__const uint32_t *) (a))[0] == 0)                     \
  395.      && (((__const uint32_t *) (a))[1] == 0)                  \
  396.      && (((__const uint32_t *) (a))[2] == htonl (0xffff)))
  397.  
  398. #define IN6_IS_ADDR_V4COMPAT(a) \
  399.     ((((__const uint32_t *) (a))[0] == 0)                     \
  400.      && (((__const uint32_t *) (a))[1] == 0)                  \
  401.      && (((__const uint32_t *) (a))[2] == 0)                  \
  402.      && (ntohl (((__const uint32_t *) (a))[3]) > 1))
  403.  
  404. #define IN6_ARE_ADDR_EQUAL(a,b) \
  405.     ((((__const uint32_t *) (a))[0] == ((__const uint32_t *) (b))[0])     \
  406.      && (((__const uint32_t *) (a))[1] == ((__const uint32_t *) (b))[1])  \
  407.      && (((__const uint32_t *) (a))[2] == ((__const uint32_t *) (b))[2])  \
  408.      && (((__const uint32_t *) (a))[3] == ((__const uint32_t *) (b))[3]))
  409.  
  410. /* Bind socket to a privileged IP port.  */
  411. extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) __THROW;
  412.  
  413. /* The IPv6 version of this function.  */
  414. extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in)
  415.      __THROW;
  416.  
  417.  
  418. #define IN6_IS_ADDR_MC_NODELOCAL(a) \
  419.     (IN6_IS_ADDR_MULTICAST(a)                         \
  420.      && ((((__const uint8_t *) (a))[1] & 0xf) == 0x1))
  421.  
  422. #define IN6_IS_ADDR_MC_LINKLOCAL(a) \
  423.     (IN6_IS_ADDR_MULTICAST(a)                         \
  424.      && ((((__const uint8_t *) (a))[1] & 0xf) == 0x2))
  425.  
  426. #define IN6_IS_ADDR_MC_SITELOCAL(a) \
  427.     (IN6_IS_ADDR_MULTICAST(a)                         \
  428.      && ((((__const uint8_t *) (a))[1] & 0xf) == 0x5))
  429.  
  430. #define IN6_IS_ADDR_MC_ORGLOCAL(a) \
  431.     (IN6_IS_ADDR_MULTICAST(a)                         \
  432.      && ((((__const uint8_t *) (a))[1] & 0xf) == 0x8))
  433.  
  434. #define IN6_IS_ADDR_MC_GLOBAL(a) \
  435.     (IN6_IS_ADDR_MULTICAST(a)                         \
  436.      && ((((__const uint8_t *) (a))[1] & 0xf) == 0xe))
  437.  
  438. /* IPv6 packet information.  */
  439. struct in6_pktinfo
  440.   {
  441.     struct in6_addr ipi6_addr;  /* src/dst IPv6 address */
  442.     unsigned int ipi6_ifindex;  /* send/recv interface index */
  443.   };
  444.  
  445. /* IPv6 MTU information.  */
  446. struct ip6_mtuinfo
  447.   {
  448.     struct sockaddr_in6 ip6m_addr; /* dst address including zone ID */
  449.     uint32_t ip6m_mtu;         /* path MTU in host byte order */
  450.   };
  451.  
  452.  
  453. #ifdef __USE_GNU
  454. /* Obsolete hop-by-hop and Destination Options Processing (RFC 2292).  */
  455. extern int inet6_option_space (int __nbytes)
  456.      __THROW __attribute_deprecated__;
  457. extern int inet6_option_init (void *__bp, struct cmsghdr **__cmsgp,
  458.                   int __type) __THROW __attribute_deprecated__;
  459. extern int inet6_option_append (struct cmsghdr *__cmsg,
  460.                 __const uint8_t *__typep, int __multx,
  461.                 int __plusy) __THROW __attribute_deprecated__;
  462. extern uint8_t *inet6_option_alloc (struct cmsghdr *__cmsg, int __datalen,
  463.                     int __multx, int __plusy)
  464.      __THROW __attribute_deprecated__;
  465. extern int inet6_option_next (__const struct cmsghdr *__cmsg,
  466.                   uint8_t **__tptrp)
  467.      __THROW __attribute_deprecated__;
  468. extern int inet6_option_find (__const struct cmsghdr *__cmsg,
  469.                   uint8_t **__tptrp, int __type)
  470.      __THROW __attribute_deprecated__;
  471.  
  472.  
  473. /* Hop-by-Hop and Destination Options Processing (RFC 3542).  */
  474. extern int inet6_opt_init (void *__extbuf, socklen_t __extlen) __THROW;
  475. extern int inet6_opt_append (void *__extbuf, socklen_t __extlen, int __offset,
  476.                  uint8_t __type, socklen_t __len, uint8_t __align,
  477.                  void **__databufp) __THROW;
  478. extern int inet6_opt_finish (void *__extbuf, socklen_t __extlen, int __offset)
  479.      __THROW;
  480. extern int inet6_opt_set_val (void *__databuf, int __offset, void *__val,
  481.                   socklen_t __vallen) __THROW;
  482. extern int inet6_opt_next (void *__extbuf, socklen_t __extlen, int __offset,
  483.                uint8_t *__typep, socklen_t *__lenp,
  484.                void **__databufp) __THROW;
  485. extern int inet6_opt_find (void *__extbuf, socklen_t __extlen, int __offset,
  486.                uint8_t __type, socklen_t *__lenp,
  487.                void **__databufp) __THROW;
  488. extern int inet6_opt_get_val (void *__databuf, int __offset, void *__val,
  489.                   socklen_t __vallen) __THROW;
  490.  
  491.  
  492. /* Routing Header Option (RFC 3542).  */
  493. extern socklen_t inet6_rth_space (int __type, int __segments) __THROW;
  494. extern void *inet6_rth_init (void *__bp, socklen_t __bp_len, int __type,
  495.                  int __segments) __THROW;
  496. extern int inet6_rth_add (void *__bp, __const struct in6_addr *__addr) __THROW;
  497. extern int inet6_rth_reverse (__const void *__in, void *__out) __THROW;
  498. extern int inet6_rth_segments (__const void *__bp) __THROW;
  499. extern struct in6_addr *inet6_rth_getaddr (__const void *__bp, int __index)
  500.      __THROW;
  501.  
  502.  
  503. /* Multicast source filter support.  */
  504.  
  505. /* Get IPv4 source filter.  */
  506. extern int getipv4sourcefilter (int __s, struct in_addr __interface_addr,
  507.                 struct in_addr __group, uint32_t *__fmode,
  508.                 uint32_t *__numsrc, struct in_addr *__slist)
  509.      __THROW;
  510.  
  511. /* Set IPv4 source filter.  */
  512. extern int setipv4sourcefilter (int __s, struct in_addr __interface_addr,
  513.                 struct in_addr __group, uint32_t __fmode,
  514.                 uint32_t __numsrc,
  515.                 __const struct in_addr *__slist)
  516.      __THROW;
  517.  
  518.  
  519. /* Get source filter.  */
  520. extern int getsourcefilter (int __s, uint32_t __interface_addr,
  521.                 __const struct sockaddr *__group,
  522.                 socklen_t __grouplen, uint32_t *__fmode,
  523.                 uint32_t *__numsrc,
  524.                 struct sockaddr_storage *__slist) __THROW;
  525.  
  526. /* Set source filter.  */
  527. extern int setsourcefilter (int __s, uint32_t __interface_addr,
  528.                 __const struct sockaddr *__group,
  529.                 socklen_t __grouplen, uint32_t __fmode,
  530.                 uint32_t __numsrc,
  531.                 __const struct sockaddr_storage *__slist) __THROW;
  532. #endif  /* use GNU */
  533.  
  534. __END_DECLS
  535.  
  536. #endif  /* netinet/in.h */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement