1 /* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
21 #define _NETINET_IN_H 1
24 #include <sys/socket.h>
27 /* Standard well-known ports. */
30 IPPORT_ECHO = 7, /* Echo service. */
31 IPPORT_DISCARD = 9, /* Discard transmissions service. */
32 IPPORT_SYSTAT = 11, /* System status service. */
33 IPPORT_DAYTIME = 13, /* Time of day service. */
34 IPPORT_NETSTAT = 15, /* Network status service. */
35 IPPORT_FTP = 21, /* File Transfer Protocol. */
36 IPPORT_TELNET = 23, /* Telnet protocol. */
37 IPPORT_SMTP = 25, /* Simple Mail Transfer Protocol. */
38 IPPORT_TIMESERVER = 37, /* Timeserver service. */
39 IPPORT_NAMESERVER = 42, /* Domain Name Service. */
40 IPPORT_WHOIS = 43, /* Internet Whois service. */
43 IPPORT_TFTP = 69, /* Trivial File Transfer Protocol. */
45 IPPORT_FINGER = 79, /* Finger service. */
47 IPPORT_SUPDUP = 95, /* SUPDUP protocol. */
50 IPPORT_EXECSERVER = 512, /* execd service. */
51 IPPORT_LOGINSERVER = 513, /* rlogind service. */
52 IPPORT_CMDSERVER = 514,
53 IPPORT_EFSSERVER = 520,
57 IPPORT_WHOSERVER = 513,
58 IPPORT_ROUTESERVER = 520,
60 /* Ports less than this value are reserved for privileged processes. */
61 IPPORT_RESERVED = 1024,
63 /* Ports greater this value are reserved for (non-privileged) servers. */
64 IPPORT_USERRESERVED = 5000
69 #define IMPLINK_IP 155
70 #define IMPLINK_LOWEXPER 156
71 #define IMPLINK_HIGHEXPER 158
73 /* Get the definition of the macro to define the common sockaddr members. */
74 #include <sockaddrcom.h>
76 /* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS.
77 The `ip_dst' field is used for the first-hop gateway when using a
78 source route (this gets put into the header proper). */
81 struct in_addr ip_dst; /* First hop; zero without source route. */
82 char ip_opts[40]; /* Actually variable in size. */
87 /* Functions to convert between host and network byte order. */
89 extern unsigned long int ntohl __P ((unsigned long int));
90 extern unsigned short int ntohs __P ((unsigned short int));
91 extern unsigned long int htonl __P ((unsigned long int));
92 extern unsigned short int htons __P ((unsigned short int));
94 /* Bind socket FD to a privileged IP address SIN. */
95 extern int bindresvport __P ((int __fd, struct sockaddr_in * __sin));
101 #if __BYTE_ORDER == __BIG_ENDIAN
102 /* The host byte order is the same as network byte order,
103 so these functions are all just identity. */
114 #endif /* netinet/in.h */