add directory Linux-0.98

This commit is contained in:
gohigh
2024-02-19 00:21:16 -05:00
parent 265896c4ae
commit 56596ada90
13765 changed files with 3471432 additions and 0 deletions

View File

@@ -0,0 +1,224 @@
/* 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>
/* Standard well-defined IP protocols. */
enum
{
IPPROTO_IP = 0, /* Dummy protocol for TCP. */
IPPROTO_ICMP = 1, /* Internet Control Message Protocol. */
IPPROTO_GGP = 2, /* Gateway Protocol (deprecated). */
IPPROTO_TCP = 6, /* Transmission Control Protocol. */
IPPROTO_EGP = 8, /* Exterior Gateway Protocol. */
IPPROTO_PUP = 12, /* PUP protocol. */
IPPROTO_UDP = 17, /* User Datagram Protocol. */
IPPROTO_IDP = 22, /* XNS IDP protocol. */
IPPROTO_RAW = 255, /* Raw IP packets. */
IPPROTO_MAX,
};
/* 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. */
IPPROT_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
/* Internet address. */
struct in_addr
{
unsigned long int s_addr;
};
/* Definitions of the bits in an Internet address integer.
On subnets, host and network parts are found according to
the subnet mask, not these masks. */
#define IN_CLASSA(a) ((((long int) (a)) & 0x80000000) == 0)
#define IN_CLASSA_NET 0xff000000
#define IN_CLASSA_NSHIFT 24
#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET)
#define IN_CLASSA_MAX 128
#define IN_CLASSB(a) ((((long int) (a)) & 0xc0000000) == 0x80000000)
#define IN_CLASSB_NET 0xffff0000
#define IN_CLASSB_NSHIFT 16
#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
#define IN_CLASSB_MAX 65536
#define IN_CLASSC(a) ((((long int) (a)) & 0xc0000000) == 0xc0000000)
#define IN_CLASSC_NET 0xffffff00
#define IN_CLASSC_NSHIFT 8
#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
#define IN_CLASSD(a) ((((long int) (a)) & 0xf0000000) = 0xe0000000)
#define IN_MULTICAST(a) IN_CLASSD(a)
#define IN_EXPERIMENTAL(a) ((((long int) (a)) & 0xe0000000) = 0xe0000000)
#define IN_BADCLASS(a) ((((long int) (a)) & 0xf0000000) = 0xf0000000)
/* Address to accept any incoming messages. */
#define INADDR_ANY ((unsigned long int) 0x00000000)
/* Address to send to all hosts. */
#define INADDR_BROADCAST ((unsigned long int) 0xffffffff)
/* Address indicating an error return. */
#define INADDR_NONE 0xffffffff
/* Network number for local host loopback. */
#define IN_LOOPBACKNET 127
/* Address to loopback in software to local host. */
#define INADDR_LOOPBACK 0x7f000001 /* Internet address 127.0.0.1. */
/* Structure describing an Internet socket address. */
struct sockaddr_in
{
short int sin_family; /* Address family. */
unsigned short int sin_port; /* Port number. */
struct in_addr sin_addr; /* Internet address. */
/* Pad to size of `struct sockaddr'. */
unsigned char __pad[sizeof(struct sockaddr) - sizeof(short int) -
sizeof(unsigned short int) - sizeof(struct in_addr)];
};
/* Options for use with `getsockopt' and `setsockopt' at the IP level. */
#define IP_OPTIONS 1 /* IP per-packet options. */
#define IP_HDRINCL 2 /* Raw packet header option. */
/* Linux Internet number representation function declarations. */
#undef ntohl
#undef ntohs
#undef htonl
#undef htons
#ifdef __cplusplus
extern "C" {
#endif
extern unsigned long int ntohl(unsigned long int);
extern unsigned short int ntohs(unsigned short int);
extern unsigned long int htonl(unsigned long int);
extern unsigned short int htons(unsigned short int);
static __inline__ unsigned long int
__ntohl(unsigned long int x)
{
register unsigned long int tmp __asm__ ("ax") = x;
__asm__ __volatile__ ("xchgb %%al,%%ah\n\t" /* swap lower bytes */
"rorl $16,%%eax\n\t" /* swap words */
"xchgb %%al,%%ah\n\t" /* swap higher bytes */
: "=a" (tmp) : "a" (tmp) );
return tmp;
}
static __inline__ unsigned short int
__ntohs(unsigned short int x)
{
register unsigned short int tmp __asm__ ("ax") = x;
__asm__ __volatile__ ("xchgb %%al,%%ah\n\t" /* swap bytes */
: "=a" (tmp) : "a" (tmp));
return tmp;
}
static __inline__ unsigned long int
__htonl(unsigned long int x)
{
register unsigned long int tmp __asm__ ("ax") = x;
__asm__ __volatile__ ("xchgb %%al,%%ah\n\t" /* swap lower bytes */
"rorl $16,%%eax\n\t" /* swap words */
"xchgb %%al,%%ah\n\t" /* swap higher bytes */
: "=a" (tmp) : "a" (tmp));
return tmp;
}
static __inline__ unsigned short int
__htons(unsigned short int x)
{
register unsigned short int tmp __asm__ ("ax") = x;
__asm__ __volatile__ ("xchgb %%al,%%ah\n\t" /* swap bytes */
: "=a" (tmp) : "a" (tmp));
return tmp;
}
#ifdef __OPTIMIZE__
#define ntohl(x) __ntohl((x))
#define ntohs(x) __ntohs((x))
#define htonl(x) __htonl((x))
#define htons(x) __htons((x))
#endif
#ifdef __cplusplus
}
#endif
#endif /* netinet/in.h */

View File

@@ -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*/

View File

@@ -0,0 +1,96 @@
/*
* 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_TCP_H
#define _NETINET_TCP_H
#include <arpa/nameser.h>
#if 0
/*
* added by obz
*/
#define LITTLE_ENDIAN 1
#define BIG_ENDIAN 2
#ifdef i386
#define BYTE_ORDER LITTLE_ENDIAN
#else
<< BYTE_ORDER undefined >>
#endif
/*
* end added by obz
*/
#endif
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
/*
* User-settable options (used with setsockopt).
*/
#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
#define TCP_MAXSEG 0x02 /* set maximum segment size */
#endif /* _NETINET_TCP_H */