summaryrefslogtreecommitdiff
path: root/include/netinet
diff options
context:
space:
mode:
Diffstat (limited to 'include/netinet')
-rw-r--r--include/netinet/igmp.h24
-rw-r--r--include/netinet/in.h88
-rw-r--r--include/netinet/in_systm.h1
-rw-r--r--include/netinet/ip.h39
-rw-r--r--include/netinet/ip_fw.h1
-rw-r--r--include/netinet/ip_icmp.h1
-rw-r--r--include/netinet/ip_tcp.h72
-rw-r--r--include/netinet/ip_udp.h1
-rw-r--r--include/netinet/protocols.h62
-rw-r--r--include/netinet/tcp.h1
-rw-r--r--include/netinet/udp.h1
11 files changed, 291 insertions, 0 deletions
diff --git a/include/netinet/igmp.h b/include/netinet/igmp.h
new file mode 100644
index 000000000..4525630e1
--- /dev/null
+++ b/include/netinet/igmp.h
@@ -0,0 +1,24 @@
+#ifndef _NETINET_IGMP_H
+#define _NETINET_IGMP_H
+
+#include <linux/igmp.h>
+
+#ifdef __BSD_SOURCE
+
+struct igmp
+{
+ __u8 igmp_type;
+ __u8 igmp_code;
+ __u16 igmp_cksum;
+ struct in_addr igmp_group;
+};
+
+#define IGMP_MINLEN 8
+#define IGMP_MAX_HOST_REPORT_DELAY 10
+#define IGMP_TIMER_SCALE 10
+
+#define IGMP_AGE_THRESHOLD 540
+
+#endif
+
+#endif /* _NETINET_IGMP_H */
diff --git a/include/netinet/in.h b/include/netinet/in.h
new file mode 100644
index 000000000..d666c67ac
--- /dev/null
+++ b/include/netinet/in.h
@@ -0,0 +1,88 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, or (at your option)
+any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef _NETINET_IN_H
+
+#define _NETINET_IN_H 1
+#include <features.h>
+
+#include <sys/socket.h>
+
+__BEGIN_DECLS
+
+/* Standard well-known ports. */
+enum
+ {
+ IPPORT_ECHO = 7, /* Echo service. */
+ IPPORT_DISCARD = 9, /* Discard transmissions service. */
+ IPPORT_SYSTAT = 11, /* System status service. */
+ IPPORT_DAYTIME = 13, /* Time of day service. */
+ IPPORT_NETSTAT = 15, /* Network status service. */
+ IPPORT_FTP = 21, /* File Transfer Protocol. */
+ IPPORT_TELNET = 23, /* Telnet protocol. */
+ IPPORT_SMTP = 25, /* Simple Mail Transfer Protocol. */
+ IPPORT_TIMESERVER = 37, /* Timeserver service. */
+ IPPORT_NAMESERVER = 42, /* Domain Name Service. */
+ IPPORT_WHOIS = 43, /* Internet Whois service. */
+ IPPORT_MTP = 57,
+
+ IPPORT_TFTP = 69, /* Trivial File Transfer Protocol. */
+ IPPORT_RJE = 77,
+ IPPORT_FINGER = 79, /* Finger service. */
+ IPPORT_TTYLINK = 87,
+ IPPORT_SUPDUP = 95, /* SUPDUP protocol. */
+
+
+ IPPORT_EXECSERVER = 512, /* execd service. */
+ IPPORT_LOGINSERVER = 513, /* rlogind service. */
+ IPPORT_CMDSERVER = 514,
+ IPPORT_EFSSERVER = 520,
+
+ /* UDP ports. */
+ IPPORT_BIFFUDP = 512,
+ IPPORT_WHOSERVER = 513,
+ IPPORT_ROUTESERVER = 520,
+
+ /* Ports less than this value are reserved for privileged processes. */
+ IPPORT_RESERVED = 1024,
+
+ /* Ports greater this value are reserved for (non-privileged) servers. */
+ IPPORT_USERRESERVED = 5000
+ };
+
+
+/* Link numbers. */
+#define IMPLINK_IP 155
+#define IMPLINK_LOWEXPER 156
+#define IMPLINK_HIGHEXPER 158
+
+
+/*
+ * Many other definitions have been moved to <linux/in.h>,
+ * because several parts of the kernel need them. -FvK
+ */
+#include <linux/in.h>
+
+/*
+ * Bind a socket to a privileged IP port
+ */
+extern int bindresvport __P ((int __sockfd,
+ struct sockaddr_in * __sin));
+
+__END_DECLS
+
+#endif /* netinet/in.h */
diff --git a/include/netinet/in_systm.h b/include/netinet/in_systm.h
new file mode 100644
index 000000000..f481c5511
--- /dev/null
+++ b/include/netinet/in_systm.h
@@ -0,0 +1 @@
+#include <linux/in_systm.h>
diff --git a/include/netinet/ip.h b/include/netinet/ip.h
new file mode 100644
index 000000000..a6c49b6af
--- /dev/null
+++ b/include/netinet/ip.h
@@ -0,0 +1,39 @@
+#ifndef _NETINET_IP_H
+#define _NETINET_IP_H
+
+#include <features.h>
+#include <netinet/in.h>
+#include <linux/ip.h>
+
+#ifdef _BSD_SOURCE
+
+/*
+ * BSD has the following structure
+ */
+
+struct ip
+{
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 ip_hl:4,
+ ip_v:4;
+#else
+ __u8 ip_v:4,
+ ip_hl:4;
+#endif
+#define IPVERSION 4
+ __u8 ip_tos;
+ __u16 ip_len;
+ __u16 ip_id;
+ __u16 ip_off;
+ __u8 ip_ttl;
+ __u8 ip_p;
+ __u16 ip_csum;
+ struct in_addr ip_src,ip_dst;
+};
+
+#define IP_DF 0x4000 /* dont fragment flag */
+#define IP_MF 0x2000 /* more fragments flag */
+
+#endif
+
+#endif /* _NETINET_IP_H */
diff --git a/include/netinet/ip_fw.h b/include/netinet/ip_fw.h
new file mode 100644
index 000000000..278a0393f
--- /dev/null
+++ b/include/netinet/ip_fw.h
@@ -0,0 +1 @@
+#include <linux/ip_fw.h>
diff --git a/include/netinet/ip_icmp.h b/include/netinet/ip_icmp.h
new file mode 100644
index 000000000..1662e3f7f
--- /dev/null
+++ b/include/netinet/ip_icmp.h
@@ -0,0 +1 @@
+#include <linux/icmp.h>
diff --git a/include/netinet/ip_tcp.h b/include/netinet/ip_tcp.h
new file mode 100644
index 000000000..39111f275
--- /dev/null
+++ b/include/netinet/ip_tcp.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley. The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @(#)tcp.h 7.5 (Berkeley) 6/29/88
+ */
+
+#ifndef _NETINET_IP_TCP_H
+#define _NETINET_IP_TCP_H
+
+#include <endian.h>
+#include <linux/socket.h>
+#include <sys/types.h>
+
+typedef u_long tcp_seq;
+/*
+ * TCP header.
+ * Per RFC 793, September, 1981.
+ */
+struct tcphdr {
+ u_short th_sport; /* source port */
+ u_short th_dport; /* destination port */
+ tcp_seq th_seq; /* sequence number */
+ tcp_seq th_ack; /* acknowledgement number */
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ u_char th_x2:4, /* (unused) */
+ th_off:4; /* data offset */
+#endif
+#if __BYTE_ORDER == __BIG_ENDIAN
+ u_char th_off:4, /* data offset */
+ th_x2:4; /* (unused) */
+#endif
+ u_char th_flags;
+#define TH_FIN 0x01
+#define TH_SYN 0x02
+#define TH_RST 0x04
+#define TH_PUSH 0x08
+#define TH_ACK 0x10
+#define TH_URG 0x20
+ u_short th_win; /* window */
+ u_short th_sum; /* checksum */
+ u_short th_urp; /* urgent pointer */
+};
+
+#define TCPOPT_EOL 0
+#define TCPOPT_NOP 1
+#define TCPOPT_MAXSEG 2
+
+/*
+ * Default maximum segment size for TCP.
+ * With an IP MSS of 576, this is 536,
+ * but 512 is probably more convenient.
+ */
+#ifdef lint
+#define TCP_MSS 536
+#else
+#define TCP_MSS MIN(512, IP_MSS - sizeof (struct tcpiphdr))
+#endif
+
+#endif /* _NETINET_TCP_H */
diff --git a/include/netinet/ip_udp.h b/include/netinet/ip_udp.h
new file mode 100644
index 000000000..3f0d8ef7c
--- /dev/null
+++ b/include/netinet/ip_udp.h
@@ -0,0 +1 @@
+#include <linux/udp.h>
diff --git a/include/netinet/protocols.h b/include/netinet/protocols.h
new file mode 100644
index 000000000..1a619c474
--- /dev/null
+++ b/include/netinet/protocols.h
@@ -0,0 +1,62 @@
+/* protocols.h */
+#ifndef _NETINET_PROTOCOLS_H
+#define _NETINET_PROTOCOLS_H
+
+#define IP_ICMP 1
+#define IP_IGMP 2
+#define IP_GGP 3
+#define IP_ST 5
+#define IP_TCP 6
+#define IP_UCL 7
+#define IP_EGP 8
+#define IP_IGP 9
+#define IP_BBN_RCC_MON 10
+#define IP_NVP_II 11
+#define IP_PUP 12
+#define IP_ARGUS 13
+#define IP_EMCON 14
+#define IP_XNET 15
+#define IP_CHAOS 16
+#define IP_UDP 17
+#define IP_MUX 18
+#define IP_DCN_MEAS 19
+#define IP_HMP 20
+#define IP_PRM 21
+#define IP_XNS_IDP 22
+#define IP_TRUNK1 23
+#define IP_TRUNK2 24
+#define IP_LEAF1 25
+#define IP_LEAF2 26
+#define IP_RDP 27
+#define IP_IRTP 28
+#define IP_ISO_TP4 29
+#define IP_NETBLT 30
+#define IP_MFE_NSP 31
+#define IP_MERIT_INP 32
+#define IP_SEP 33
+#define IP_3PC 34
+#define IP_CFTP 62
+#define SAT_EXPAK 64
+#define IP_RVD 66
+#define IP_IPPC 67
+#define IP_SAT_MON 69
+#define IP_VISA 70
+#define IP_IPCV 71
+#define IP_BR_SAT_MON 76
+#define IP_SUN_ND 77
+#define IP_WB_MON 78
+#define IP_WB_EXPAK 79
+#define IP_ISO_IP 80
+#define IP_VMTP 81
+#define IP_SECURE_VMTP 82
+#define IP_VINES 83
+#define IP_TTP 84
+#define NSFNET_IGP 85
+#define IP_DGP 86
+#define IP_TCF 87
+#define IP_IGRP 88
+#define IP_OSPFIGP 89
+#define IP_SPRITE_RPG 90
+#define IP_LARP 91
+
+#endif /* _NETINET_PROTOCOLS_H*/
diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h
new file mode 100644
index 000000000..8636ec7d0
--- /dev/null
+++ b/include/netinet/tcp.h
@@ -0,0 +1 @@
+#include <netinet/ip_tcp.h>
diff --git a/include/netinet/udp.h b/include/netinet/udp.h
new file mode 100644
index 000000000..39a57a3c7
--- /dev/null
+++ b/include/netinet/udp.h
@@ -0,0 +1 @@
+#include <netinet/ip_udp.h>