]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
update from main archive 970217
authorUlrich Drepper <drepper@redhat.com>
Tue, 18 Feb 1997 04:08:52 +0000 (04:08 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 18 Feb 1997 04:08:52 +0000 (04:08 +0000)
34 files changed:
ChangeLog
elf/link.h
inet/netinet/ether.h
intl/l10nflist.c
io/ftw.h
login/utmp.h
malloc/obstack.h
misc/libgen.h
misc/search.h
misc/sys/syslog.h
nis/nss_nis/nis-ethers.c
nss/digits_dots.c
posix/regex.h
resolv/gethnamaddr.c
stdio-common/bug10.c
string/strcoll.c
sunrpc/rpc/auth_des.h
sunrpc/rpc/pmap_rmt.h
sysdeps/generic/ip.h [moved from inet/netinet/ip.h with 98% similarity]
sysdeps/unix/sysv/linux/Dist
sysdeps/unix/sysv/linux/Makefile
sysdeps/unix/sysv/linux/netatalk/atalk.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/netinet/icmp.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/netinet/if_fddi.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/netinet/if_tr.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/netinet/igmp.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/netinet/in.h
sysdeps/unix/sysv/linux/netinet/ip.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/netinet/ip_fw.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/netinet/ip_icmp.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/netinet/tcp.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/netinet/udp.h
sysdeps/unix/sysv/linux/netipx/ipx.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/sys/reboot.h

index e2256fa466ab6ee7995f2a5e76606553b76a87ae..3ddd6e90d7be72de44ae1ac5a5a29ba7a3f95a2f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,81 @@
+1997-02-18 03:28  Ulrich Drepper  <drepper@cygnus.com>
+
+       * stdio-common/bug10.c (main): Correct parameter.
+
+       * string/strcoll.c: Update copyright.
+
+1997-02-17 02:51  Ulrich Drepper  <drepper@cygnus.com>
+
+       * malloc/obstack.h: Add `extern "C"' protection.
+       * posix/regex.h: Likewise.
+       * io/ftw.h: Likewise.
+       * misc/libgen.h: Likewise.
+       * login/utmp.h: Likewise.
+       * sysdeps/unix/sysv/linux/sys/reboot.h: Likewise.
+       * sysdeps/unix/sysv/linux/netinet/in.h: Likewise.
+       * sunrpc/rpc/pmap_rmt.h: Likewise.
+       * sunrpc/rpc/auth_des.h: Likewise.
+       * elf/link.h: Likewise.
+       * inet/netinet/ether.h: Likewise.
+       Reported by HJ Lu.
+
+1997-02-17 01:45  a sun  <asun@zoology.washington.edu>
+
+       Linux specific network headers.
+       * sysdeps/unix/sysv/linux/netinet/if_fddi.h: New file.
+       * sysdeps/unix/sysv/linux/netinet/if_tr.h: New file.
+       * sysdeps/unix/sysv/linux/netinet/ip_icmp.h: New file.
+       * sysdeps/unix/sysv/linux/netinet/ip_fw.h: New file.
+       * sysdeps/unix/sysv/linux/netinet/igmp.h: New file.
+       * sysdeps/unix/sysv/linux/netinet/icmp.h: New file.
+       * sysdeps/unix/sysv/linux/netinet/ip.h: New file.
+       * sysdeps/unix/sysv/linux/netinet/tcp.h: New file.
+       * sysdeps/unix/sysv/linux/netipx/ipx.h: New file.
+       * sysdeps/unix/sysv/linux/netatalk/atalk.h: New file.
+       * sysdeps/unix/sysv/linux/Dist: Add new network headers.
+       * sysdeps/unix/sysv/linux/Makefile [$(subdir)=misc] (sysdep_headers):
+       Add sys/quota.h.
+       [$(subdir)=inet] (sysdep_headers): Add new network header.
+
+       * sysdeps/unix/sysv/linux/netinet/udp.h: Add Linux specific changes.
+       * sysdeps/unix/sysv/linux/netinet/in.h: Likewise.
+
+       * inet/netinet/ip.h: Move to sysdeps/generic.
+
+1997-02-16 13:15 1997  H.J. Lu  <hjl@gnu.ai.mit.edu>
+
+       * inet/netinet/ip.h: Add protection.
+
+1997-02-17 01:18  Ulrich Drepper  <drepper@cygnus.com>
+
+       * misc/sys/syslog.h (prioritynames): Correct definition to use
+       braces where necessary.
+       (facilitynames): Likewise.
+       Patch by Ronald F. Guilmette <rfg@monkeys.com>.
+       Comment and beautify declarations.
+
+1997-02-16 03:54  Ulrich Drepper  <drepper@cygnus.com>
+
+       * sysdeps/unix/sysv/linux/netinet/in.h: Declare bindresvport.
+       Reported by fabsoft@fabserver1.zarm.uni-bremen.de.
+
+1997-02-16 03:48  Thorsten Kukuk  <kukuk@weber.uni-paderborn.de>
+
+       * nis/nss_nis/nis-ethers.c (_nss_nis_getethernam_r): Rename to
+       _nss_nis_gethostton_r.
+       (_nss_nis_getetherbyaddr_r): Rename to _nss_nis_getntohost_r.
+
+1997-02-16 02:45  Ulrich Drepper  <drepper@cygnus.com>
+
+       * intl/l10nflist.c (_nl_make_l10nflist): Fix bug in computation of
+       length of abs_filename.
+
+1997-02-15 22:37  Andy Berkheimer  <andy@tho.org>
+
+       * resolv/gethnamaddr.c (gethostbyname2): Test for ':' in name before
+       trying to resolv name as numeric IPv6 address.
+       * nss/digits_dots.c: Likewise.
+
 1997-02-13 11:44  Andreas Jaeger  <aj@arthur.pfalz.de>
 
        * stdlib/qsort.c: Add prototype for _quicksort.
index b05ecca199314f9c41237cff41258bdec886f38d..42e6fa5066680f9dc84cbc1c09ba1a42365805a2 100644 (file)
@@ -25,6 +25,8 @@
 
 #include <elf.h>
 
+__BEGIN_DECLS
+
 /* We use this macro to refer to ELF types independent of the native wordsize.
    `ElfW(TYPE)' is used in place of `Elf32_TYPE' or `Elf64_TYPE'.  */
 #define ElfW(type)     _ElfW (Elf, __ELF_NATIVE_CLASS, type)
@@ -340,5 +342,6 @@ extern void _dl_debug_state (void);
    in the `r_ldbase' member.  Returns the address of the structure.  */
 extern struct r_debug *_dl_debug_initialize (ElfW(Addr) ldbase);
 
+__END_DECLS
 
 #endif /* link.h */
index b14377a13d3a6cf02d2517c8673d62e5a981a56f..06d01b1508b9c9f53165a7bf6707060197d748f8 100644 (file)
@@ -1,21 +1,21 @@
 /* Functions for storing Ethernet addresses in ASCII and mapping to hostnames.
-Copyright (C) 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+   Copyright (C) 1996, 1997 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 Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, 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
-Library General Public License for more details.
+   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
+   Library General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef __NETINET_ETHER_H
 
@@ -25,24 +25,30 @@ Boston, MA 02111-1307, USA.  */
 /* Get definition of `struct ether_addr'.  */
 #include <netinet/if_ether.h>
 
+__BEGIN_DECLS
 
 /* Convert 48 bit Ethernet ADDRess to ASCII.  */
-char *ether_ntoa __P ((const struct ether_addr *__addr));
-char *ether_ntoa_r __P ((const struct ether_addr *__addr, char *__buf));
+extern char *ether_ntoa __P ((__const struct ether_addr *__addr));
+extern char *ether_ntoa_r __P ((__const struct ether_addr *__addr,
+                               char *__buf));
 
 /* Convert ASCII string S to 48 bit Ethernet address.  */
-struct ether_addr *ether_aton __P ((const char *__asc));
-struct ether_addr *ether_aton_r __P ((const char *__asc,
-                                     struct ether_addr *__addr));
+extern struct ether_addr *ether_aton __P ((__const char *__asc));
+extern struct ether_addr *ether_aton_r __P ((__const char *__asc,
+                                            struct ether_addr *__addr));
 
 /* Map 48 bit Ethernet number ADDR to HOSTNAME.  */
-int ether_ntohost __P ((char *__hostname, const struct ether_addr *__addr));
+extern int ether_ntohost __P ((char *__hostname,
+                              __const struct ether_addr *__addr));
 
 /* Map HOSTNAME to 48 bit Ethernet address.  */
-int ether_hostton __P ((const char *__hostname, struct ether_addr *__addr));
+extern int ether_hostton __P ((__const char *__hostname,
+                              struct ether_addr *__addr));
 
 /* Scan LINE and set ADDR and HOSTNAME.  */
-int ether_line __P ((const char *__line, struct ether_addr *__addr,
-                    char *__hostname));
+extern int ether_line __P ((__const char *__line, struct ether_addr *__addr,
+                           char *__hostname));
+
+__END_DECLS
 
 #endif /* netinet/ether.h */
index d16bff01facac8c4380dbdeb630b1f5546e9a209..4f45d3db4ebf0c6307acf81e4275f9ae46f6b283 100644 (file)
@@ -206,7 +206,8 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
                                     ? strlen (modifier) + 1 : 0)
                                  + ((mask & CEN_SPECIAL) != 0
                                     ? strlen (special) + 1 : 0)
-                                 + ((mask & (CEN_SPONSOR | CEN_REVISION) != 0)
+                                 + (((mask & CEN_SPONSOR) != 0
+                                     || (mask & CEN_REVISION) != 0)
                                     ? (1 + ((mask & CEN_SPONSOR) != 0
                                             ? strlen (sponsor) + 1 : 0)
                                        + ((mask & CEN_REVISION) != 0
index 0bfdf37431a0af16085df42834c0690cf06d12a8..a04e7d8c4140dd6f33e8d65813f2335a249d9991 100644 (file)
--- a/io/ftw.h
+++ b/io/ftw.h
@@ -26,6 +26,8 @@
 #define        _FTW_H  1
 #include <features.h>
 
+__BEGIN_DECLS
+
 #include <statbuf.h>
 
 /* The FLAG argument to the user function passed to ftw.  */
@@ -41,4 +43,6 @@ extern int ftw __P ((__const char *__dir,
                                    int __flag),
                     int __descriptors));
 
+__END_DECLS
+
 #endif /* ftw.h */
index 6fd89ddc28eba2a3e3609dd79dc02b2d1910e253..402ab25cb612d25e817a264b32f322f8b7558db4 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <sys/types.h>
 
+__BEGIN_DECLS
 
 /* Get system dependent values and data structures.  */
 #include <utmpbits.h>
index 0e7eb09054660df5374e17181473c05d2a2c02e0..54c4d51457620a9103d755e06a46cd47a9c6263b 100644 (file)
@@ -106,6 +106,10 @@ Summary:
 
 #ifndef __OBSTACK_H__
 #define __OBSTACK_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 \f
 /* We use subtraction of (char *) 0 instead of casting to int
    because on word-addressable machines a simple cast to int
@@ -578,4 +582,8 @@ __extension__                                                               \
 
 #endif /* not __GNUC__ or not __STDC__ */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* not __OBSTACK_H__ */
index be8258e72a7b9d9226cbb049ddc06081506a68fe..2c5d642e15657cf8ad14b54d7048a7bddf4237c4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 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
 #define _LIBGEN_H      1
 #include <sys/cdefs.h>
 
+__BEGIN_DECLS
+
 /* Return directory part of PATH or "." if none is available.  */
 extern char *dirname __P ((char *__path));
 
 /* Return filename part of PATH.  */
 extern char *basename __P ((__const char *__path));
 
+__END_DECLS
+
 #endif /* libgen.h */
index d0097429e9f5fb6c62c01f18273725e35de829ff..4cfbaeabd378d15db887d364337386d3fc561b41 100644 (file)
@@ -1,5 +1,5 @@
-/* search.h -- declarations for System V style searching functions.
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+/* Declarations for System V style searching functions.
+   Copyright (C) 1995, 1996, 1997 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
index 241a74d52c8f69f8c0d04f04fde5f7d40e378e50..6da3a3b4c3fe096fd22362f067af15d851cb6111 100644 (file)
@@ -67,21 +67,22 @@ typedef struct _code {
        int     c_val;
 } CODE;
 
-CODE prioritynames[] = {
-       "alert",        LOG_ALERT,
-       "crit",         LOG_CRIT,
-       "debug",        LOG_DEBUG,
-       "emerg",        LOG_EMERG,
-       "err",          LOG_ERR,
-       "error",        LOG_ERR,                /* DEPRECATED */
-       "info",         LOG_INFO,
-       "none",         INTERNAL_NOPRI,         /* INTERNAL */
-       "notice",       LOG_NOTICE,
-       "panic",        LOG_EMERG,              /* DEPRECATED */
-       "warn",         LOG_WARNING,            /* DEPRECATED */
-       "warning",      LOG_WARNING,
-       NULL,           -1,
-};
+CODE prioritynames[] =
+  {
+    { "alert", LOG_ALERT },
+    { "crit", LOG_CRIT },
+    { "debug", LOG_DEBUG },
+    { "emerg", LOG_EMERG },
+    { "err", LOG_ERR },
+    { "error", LOG_ERR },              /* DEPRECATED */
+    { "info", LOG_INFO },
+    { "none", INTERNAL_NOPRI },                /* INTERNAL */
+    { "notice", LOG_NOTICE },
+    { "panic", LOG_EMERG },            /* DEPRECATED */
+    { "warn", LOG_WARNING },           /* DEPRECATED */
+    { "warning", LOG_WARNING },
+    { NULL, -1 }
+  };
 #endif
 
 /* facility codes */
@@ -114,31 +115,32 @@ CODE prioritynames[] = {
 #define        LOG_FAC(p)      (((p) & LOG_FACMASK) >> 3)
 
 #ifdef SYSLOG_NAMES
-CODE facilitynames[] = {
-       "auth",         LOG_AUTH,
-       "authpriv",     LOG_AUTHPRIV,
-       "cron",         LOG_CRON,
-       "daemon",       LOG_DAEMON,
-       "ftp",          LOG_FTP,
-       "kern",         LOG_KERN,
-       "lpr",          LOG_LPR,
-       "mail",         LOG_MAIL,
-       "mark",         INTERNAL_MARK,          /* INTERNAL */
-       "news",         LOG_NEWS,
-       "security",     LOG_AUTH,               /* DEPRECATED */
-       "syslog",       LOG_SYSLOG,
-       "user",         LOG_USER,
-       "uucp",         LOG_UUCP,
-       "local0",       LOG_LOCAL0,
-       "local1",       LOG_LOCAL1,
-       "local2",       LOG_LOCAL2,
-       "local3",       LOG_LOCAL3,
-       "local4",       LOG_LOCAL4,
-       "local5",       LOG_LOCAL5,
-       "local6",       LOG_LOCAL6,
-       "local7",       LOG_LOCAL7,
-       NULL,           -1,
-};
+CODE facilitynames[] =
+  {
+    { "auth", LOG_AUTH },
+    { "authpriv", LOG_AUTHPRIV },
+    { "cron", LOG_CRON },
+    { "daemon", LOG_DAEMON },
+    { "ftp", LOG_FTP },
+    { "kern", LOG_KERN },
+    { "lpr", LOG_LPR },
+    { "mail", LOG_MAIL },
+    { "mark", INTERNAL_MARK },         /* INTERNAL */
+    { "news", LOG_NEWS },
+    { "security", LOG_AUTH },          /* DEPRECATED */
+    { "syslog", LOG_SYSLOG },
+    { "user", LOG_USER },
+    { "uucp", LOG_UUCP },
+    { "local0", LOG_LOCAL0 },
+    { "local1", LOG_LOCAL1 },
+    { "local2", LOG_LOCAL2 },
+    { "local3", LOG_LOCAL3 },
+    { "local4", LOG_LOCAL4 },
+    { "local5", LOG_LOCAL5 },
+    { "local6", LOG_LOCAL6 },
+    { "local7", LOG_LOCAL7 },
+    { NULL, -1 }
+  };
 #endif
 
 #ifdef KERNEL
@@ -186,11 +188,23 @@ CODE facilitynames[] = {
 #include <sys/cdefs.h>
 
 __BEGIN_DECLS
-void   closelog __P((void));
-void   openlog __P((const char *, int, int));
-int    setlogmask __P((int));
-void   syslog __P((int, const char *, ...));
-void   vsyslog __P((int, const char *, _BSD_VA_LIST_));
+
+/* Close desriptor used to write to system logger.  */
+extern void closelog __P ((void));
+
+/* Open connection to system logger.  */
+extern void openlog __P ((__const char *__ident, int __option,
+                         int __facility));
+
+/* Set the log mask level.  */
+extern int setlogmask __P ((int __mask));
+
+/* Generate a log message using FMT string and option arguments.  */
+extern void syslog __P ((int __pri, __const char *__fmt, ...));
+
+/* Generate a log message using FMT and using arguments pointed to by AP.  */
+extern void vsyslog __P ((int __pri, __const char *__fmt, _BSD_VA_LIST_ __ap));
+
 __END_DECLS
 
 #endif /* !KERNEL */
index 25f77f5f82446fba4f21dc42b89ac1e4a74ddc9e..d257cd7e4b0206caa6dcd6fd863cd1e5e6c3ef0b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
 
@@ -156,8 +156,8 @@ _nss_nis_getetherent_r (struct ether *result, char *buffer, size_t buflen)
 }
 
 enum nss_status
-_nss_nis_getethernam_r (const char *name, struct ether *eth,
-                       char *buffer, size_t buflen)
+_nss_nis_gethostton_r (const char *name, struct ether *eth,
+                      char *buffer, size_t buflen)
 {
   struct parser_data *data = (void *) buffer;
   enum nss_status retval;
@@ -210,8 +210,8 @@ _nss_nis_getethernam_r (const char *name, struct ether *eth,
 }
 
 enum nss_status
-_nss_nis_getetherbyaddr_r (struct ether_addr *addr, struct ether *eth,
-                          char *buffer, size_t buflen)
+_nss_nis_getntohost_r (struct ether_addr *addr, struct ether *eth,
+                      char *buffer, size_t buflen)
 {
   struct parser_data *data = (void *) buffer;
   enum nss_status retval;
index b86f66cf4d9a0b0655170d0033b5378e08fa0e12..c953fc6ec6e61d841aee06495dc3fb3dd1ac8daa 100644 (file)
            {
              if (!*cp)
                {
-                 if (*--cp == '.') break;
+                 if (*--cp == '.')
+                   break;
+                 if (!strchr (name, ':'))
+                   break;
 
                  /* All-IPv6-legal, no dot at the end. Fake up a
                     hostent as if we'd actually done a lookup.  */
index 565d24e09d339d7678e19f02feb2976d68cc0fb9..254a17687e4b69cfb3fac233f4f1656cbb271377 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions for data structures and routines for the regular
    expression library, version 0.12.
-   Copyright (C) 1985,89,90,91,92,93,95,96 Free Software Foundation, Inc.
+   Copyright (C) 1985,89,90,91,92,93,95,96,97 Free Software Foundation, Inc.
 
    This file is part of the GNU C Library.  Its master source is NOT part of
    the C library, however.  The master source lives in /gd/gnu/lib.
 #ifndef __REGEXP_LIBRARY_H__
 #define __REGEXP_LIBRARY_H__
 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* POSIX says that <sys/types.h> must be included (by the caller) before
    <regex.h>.  */
 
@@ -487,6 +492,11 @@ extern size_t regerror
              size_t errbuf_size));
 extern void regfree _RE_ARGS ((regex_t *preg));
 
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* not __REGEXP_LIBRARY_H__ */
 \f
 /*
index 424a6690eee61115724d35f755376abbef380948..69666d062b5604a0d1da18889e91238a63a6caee 100644 (file)
@@ -513,6 +513,8 @@ gethostbyname2(name, af)
                        if (!*cp) {
                                if (*--cp == '.')
                                        break;
+                               if (!strchr (name, ':'))
+                                       break;
                                /*
                                 * All-IPv6-legal, no dot at the end.
                                 * Fake up a hostent as if we'd actually
index 3e15526a43fc7520b5d66972b9849062b13f49dd..c4f328d4cb6dbe7cb8d0bc50aff780ddaf8c04a1 100644 (file)
@@ -1,7 +1,7 @@
 #include <stdio.h>
 
 int
-main (int arc, char *argv)
+main (int arc, char *argv[])
 {
   int n, res;
   unsigned int val;
index fa1025e0d7652e4e604a6abc902a4fdc2fcb1fab..aae5944771cf6ff4a9936b5c290ce8317a2e5864 100644 (file)
@@ -1,21 +1,21 @@
-/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
-
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, 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
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <stddef.h>
 #include <stdlib.h>
index 097eb6877104a91c88e862c8420f3f49eaabc285..8c2f7946910b842dbc040ee88b76a2a8adaeaa7e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 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
@@ -21,6 +21,8 @@
 #define _RPC_AUTH_DES_H        1
 #include <sys/cdefs.h>
 
+__BEGIN_DECLS
+
 /* This is no complete version of this header.  More definitions with
    the real authentication stuff will come in 1997.  For now we only
    need to define the function for handling public keys.  */
@@ -39,4 +41,6 @@ extern int getpublickey __P ((__const char *__name, char *__key));
 extern int getsecretkey __P ((__const char *__name, char *__key,
                              __const char *__passwd));
 
+__END_DECLS
+
 #endif /* rpc/auth_des.h */
index f5d4af110ba0db5654aa7fc3753b4cb54c586e3c..0489bb5c4f9fd9c31acba5b22531a1facd22faa7 100644 (file)
@@ -40,6 +40,7 @@
 #define _RPC_PMAP_RMT_H        1
 #include <features.h>
 
+__BEGIN_DECLS
 
 struct rmtcallargs {
        u_long prog, vers, proc, arglen;
@@ -47,7 +48,7 @@ struct rmtcallargs {
        xdrproc_t xdr_args;
 };
 
-bool_t xdr_rmtcall_args __P ((XDR *__xdrs, struct rmtcallargs *__crp));
+extern bool_t xdr_rmtcall_args __P ((XDR *__xdrs, struct rmtcallargs *__crp));
 
 struct rmtcallres {
        u_long *port_ptr;
@@ -56,7 +57,8 @@ struct rmtcallres {
        xdrproc_t xdr_results;
 };
 
-bool_t xdr_rmtcallres __P ((XDR *__xdrs, struct rmtcallres *__crp));
+extern bool_t xdr_rmtcallres __P ((XDR *__xdrs, struct rmtcallres *__crp));
 
+__END_DECLS
 
 #endif /* rpc/pmap_rmt.h */
similarity index 98%
rename from inet/netinet/ip.h
rename to sysdeps/generic/ip.h
index 191ac8e9c8c8e4c3561fbf376ee612532bb62377..a119c629f7d35a8b375a904f8d167133569cec65 100644 (file)
@@ -33,6 +33,9 @@
  *     @(#)ip.h        8.1 (Berkeley) 6/10/93
  */
 
+#ifndef _NETINET_IP_H
+#define _NETINET_IP_H
+
 #include <gnu/types.h>
 #include <endian.h>
 #include <netinet/in.h>
@@ -165,3 +168,5 @@ struct      ip_timestamp {
 #define        IPTTLDEC        1               /* subtracted when forwarding */
 
 #define        IP_MSS          576             /* default maximum segment size */
+
+#endif /* netinet/ip.h. */
index 0660b247ef6ec970a56be53f964b0dda67ec9932..0c5903dc89758822b8d262b4d66da056f82e1ca8 100644 (file)
@@ -11,8 +11,16 @@ net/if_ppp.h
 net/ppp-comp.h
 net/ppp_defs.h
 net/route.h
+netatalk/atalk.h
+netinet/icmp.h
+netinet/if_fddi.h
+netinet/if_tr.h
+netinet/igmp.h
 netinet/in_systm.h
+netinet/ip_fw.h
+netinet/ip_icmp.h
 netinet/udp.h
+netipx/ipx.h
 nfs/nfs.h
 sys/acct.h
 sys/debugreg.h
index e02ee8cfe471be4f26d7bda5fcdbbcd5d1ab3693..a72fef234651ea83638221801ec0910378c9c50d 100644 (file)
@@ -10,7 +10,8 @@ sysdep_routines += sysctl clone llseek
 sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h sys/mtio.h \
                  sys/module.h sys/io.h sys/klog.h sys/kdaemon.h \
                  sys/user.h syscall-list.h sys/sysmacros.h sys/procfs.h \
-                 sys/debugreg.h sys/kd.h sys/soundcard.h sys/vt.h
+                 sys/debugreg.h sys/kd.h sys/soundcard.h sys/vt.h \
+                 sys/quota.h
 
 # Generate the list of SYS_* macros for the system calls (__NR_* macros).
 $(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/sys/syscall.h
@@ -52,7 +53,9 @@ inhibit-siglist := yes
 endif
 
 ifeq ($(subdir),inet)
-sysdep_headers += netinet/in_systm.h sys/socketvar.h
+sysdep_headers += netinet/in_systm.h netinet/udp.h netinet/icmp.h \
+                 netinet/if_fddi.h netinet/if_tr.h netinet/igmp.h \
+                 netinet/ip_fw.h netinet/ip_icmp.h sys/socketvar.h
 endif
 
 # Don't compile the ctype glue code, since there is no old non-GNU C library.
diff --git a/sysdeps/unix/sysv/linux/netatalk/atalk.h b/sysdeps/unix/sysv/linux/netatalk/atalk.h
new file mode 100644 (file)
index 0000000..be3a72d
--- /dev/null
@@ -0,0 +1,27 @@
+/* Copyright (C) 1991, 92, 93, 95, 96, 97 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef __NETATALK_ATALK_H
+#define __NETATALK_ATALK_H 1
+
+#include <asm/types.h>
+#include <linux/atalk.h>
+
+#define SOL_ATALK       258     /* sockopt level for atalk */
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/netinet/icmp.h b/sysdeps/unix/sysv/linux/netinet/icmp.h
new file mode 100644 (file)
index 0000000..f6b2d8a
--- /dev/null
@@ -0,0 +1,25 @@
+/* Copyright (C) 1991, 92, 93, 95, 96, 97 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _NETINET_ICMP_H
+#define        _NETINET_ICMP_H 1
+
+#include <asm/types.h>
+#include <linux/icmp.h>
+
+#endif /* netinet/icmp.h */
diff --git a/sysdeps/unix/sysv/linux/netinet/if_fddi.h b/sysdeps/unix/sysv/linux/netinet/if_fddi.h
new file mode 100644 (file)
index 0000000..d5d6dbd
--- /dev/null
@@ -0,0 +1,37 @@
+/* Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _NETINET_IF_FDDI_H
+#define        _NETINET_IF_FDDI_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <asm/types.h>
+
+#include <linux/if_fddi.h>
+
+#ifdef __USE_BSD
+
+struct fddi_header {
+  u_int8_t fddi_fc;                    /* Frame Control (FC) value */
+  u_int8_t fddi_dhost[FDDI_K_ALEN];    /* Destination host */
+  u_int8_t fddi_shost[FDDI_K_ALEN];    /* Source host */
+};
+#endif
+
+#endif /* netinet/if_fddi.h */
diff --git a/sysdeps/unix/sysv/linux/netinet/if_tr.h b/sysdeps/unix/sysv/linux/netinet/if_tr.h
new file mode 100644 (file)
index 0000000..3c1be21
--- /dev/null
@@ -0,0 +1,41 @@
+/* Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _NETINET_IF_TR_H
+#define        _NETINET_IF_TR_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <asm/types.h>
+
+#include <linux/if_tr.h>
+
+#ifdef __USE_BSD
+
+struct trn_hdr {
+  u_int8_t trn_ac;                /* access control field */
+  u_int8_t trn_fc;                /* field control field */
+  u_int8_t trn_dhost[TR_ALEN];    /* destination host */
+  u_int8_t trn_shost[TR_ALEN];    /* source host */
+  u_int16_t trn_rcf;              /* route control field */
+  u_int16_t trn_rseg[8];          /* routing registers */
+};
+
+#endif
+
+#endif /* netinet/if_tr.h */
diff --git a/sysdeps/unix/sysv/linux/netinet/igmp.h b/sysdeps/unix/sysv/linux/netinet/igmp.h
new file mode 100644 (file)
index 0000000..7a6ed6e
--- /dev/null
@@ -0,0 +1,93 @@
+/* Copyright (C) 1997 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _NETINET_IGMP_H
+#define        _NETINET_IGMP_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include <asm/types.h>
+#include <linux/igmp.h>
+
+#ifdef __USE_BSD
+
+#include <netinet/in.h>
+
+__BEGIN_DECLS
+
+/*
+ * Copyright (c) 1988 Stephen Deering.
+ * Copyright (c) 1992, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Stephen Deering of Stanford University.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)igmp.h      8.1 (Berkeley) 6/10/93
+ *     $FreeBSD$
+ */
+
+struct igmp {
+  u_int8_t igmp_type;             /* IGMP type */
+  u_int8_t igmp_code;             /* routing code */
+  u_int16_t igmp_cksum;           /* checksum */
+  struct in_addr igmp_group;      /* group address */
+};
+
+/*
+ * Message types, including version number.
+ */
+#define IGMP_MEMBERSHIP_QUERY          0x11    /* membership query         */
+#define IGMP_V1_MEMBERSHIP_REPORT      0x12    /* Ver. 1 membership report */
+#define IGMP_V2_MEMBERSHIP_REPORT      0x16    /* Ver. 2 membership report */
+#define IGMP_V2_LEAVE_GROUP            0x17    /* Leave-group message      */
+
+__END_DECLS
+
+#endif
+
+#endif /* netinet/igmp.h */
index 0fec8ce3dd6154215424b02c5822838c5d254afb..a45bb664adac52d0698a1ee40b13276ef02a26af 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <sys/socket.h>
 
+__BEGIN_DECLS
 
 /* Standard well-defined IP protocols.  */
 enum
@@ -203,4 +204,10 @@ extern unsigned short int htons __P ((unsigned short int));
 #define        htons(x)        (x)
 #endif
 
+
+/* Bind socket to a priviledged IP port.  */
+extern int bindresvport __P ((int __sockfd, struct sockaddr_in *__sin));
+
+__END_DECLS
+
 #endif /* netinet/in.h */
diff --git a/sysdeps/unix/sysv/linux/netinet/ip.h b/sysdeps/unix/sysv/linux/netinet/ip.h
new file mode 100644 (file)
index 0000000..c779db4
--- /dev/null
@@ -0,0 +1,254 @@
+/* Copyright (C) 1991, 92, 93, 95, 96, 97 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef __NETINET_IP_H
+#define __NETINET_IP_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include <netinet/in.h>
+
+__BEGIN_DECLS
+
+struct timestamp {
+       u_int8_t        len;
+       u_int8_t        ptr;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+       u_int8_t        flags:4,
+               overflow:4;
+#elif __BYTE_ORDER == __BIG_ENDIAN
+       u_int8_t        overflow:4,
+               flags:4;
+#else
+#error "Please fix <bytesex.h>"
+#endif                                         
+       u_int32_t       data[9];
+};
+
+struct ip_options {
+  u_int32_t    faddr;          /* Saved first hop address */
+  u_int8_t     optlen;
+  u_int8_t srr;
+  u_int8_t rr;
+  u_int8_t ts;
+  u_int8_t is_setbyuser:1,     /* Set by setsockopt?                   */
+                is_data:1,     /* Options in __data, rather than skb   */
+                is_strictroute:1, /* Strict source route               */
+                srr_is_hit:1,  /* Packet destination addr was our one  */
+                is_changed:1,  /* IP checksum more not valid           */      
+                rr_needaddr:1, /* Need to record addr of outgoing dev  */
+                ts_needtime:1, /* Need to record timestamp             */
+                ts_needaddr:1; /* Need to record addr of outgoing dev  */
+  u_int8_t router_alert;
+  u_int8_t __pad1;
+  u_int8_t __pad2;
+  u_int8_t __data[0];
+};
+
+struct iphdr {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+       u_int8_t        ihl:4,
+               version:4;
+#elif __BYTE_ORDER == __BIG_ENDIAN
+       u_int8_t        version:4,
+               ihl:4;
+#else
+#error "Please fix <bytesex.h>"
+#endif
+       u_int8_t        tos;
+       u_int16_t       tot_len;
+       u_int16_t       id;
+       u_int16_t       frag_off;
+       u_int8_t        ttl;
+       u_int8_t        protocol;
+       u_int16_t       check;
+       u_int32_t       saddr;
+       u_int32_t       daddr;
+       /*The options start here. */
+};
+
+#ifdef __USE_BSD
+/*
+ * Copyright (c) 1982, 1986, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)ip.h        8.1 (Berkeley) 6/10/93
+ */
+
+/*
+ * Definitions for internet protocol version 4.
+ * Per RFC 791, September 1981.
+ */
+
+/*
+ * Structure of an internet header, naked of options.
+ */
+struct ip {
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+       u_int8_t  ip_hl:4,              /* header length */
+                 ip_v:4;               /* version */
+#endif
+#if __BYTE_ORDER == __BIG_ENDIAN
+       u_int8_t  ip_v:4,               /* version */
+                 ip_hl:4;              /* header length */
+#endif
+       u_int8_t  ip_tos;               /* type of service */
+       u_short ip_len;         /* total length */
+       u_short ip_id;          /* identification */
+       u_short ip_off;         /* fragment offset field */
+#define        IP_RF 0x8000                    /* reserved fragment flag */
+#define        IP_DF 0x4000                    /* dont fragment flag */
+#define        IP_MF 0x2000                    /* more fragments flag */
+#define        IP_OFFMASK 0x1fff               /* mask for fragmenting bits */
+       u_int8_t  ip_ttl;               /* time to live */
+       u_int8_t  ip_p;                 /* protocol */
+       u_short ip_sum;         /* checksum */
+       struct    in_addr ip_src, ip_dst; /* source and dest address */
+};
+
+/*
+ * Time stamp option structure.
+ */
+struct ip_timestamp {
+       u_int8_t ipt_code;              /* IPOPT_TS */
+       u_int8_t ipt_len;               /* size of structure (variable) */
+       u_int8_t ipt_ptr;               /* index of current entry */
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+       u_int8_t ipt_flg:4,             /* flags, see below */
+                ipt_oflw:4;            /* overflow counter */
+#endif
+#if __BYTE_ORDER == __BIG_ENDIAN
+       u_int8_t ipt_oflw:4,            /* overflow counter */
+                ipt_flg:4;             /* flags, see below */
+#endif
+       u_int32_t data[9];
+};
+#endif /* __USE_BSD */
+
+#define        IPVERSION       4               /* IP version number */
+#define        IP_MAXPACKET    65535           /* maximum packet size */
+
+/*
+ * Definitions for IP type of service (ip_tos)
+ */
+#define        IPTOS_LOWDELAY          0x10
+#define        IPTOS_THROUGHPUT        0x08
+#define        IPTOS_RELIABILITY       0x04
+#define        IPTOS_LOWCOST           0x02
+#define        IPTOS_MINCOST           IPTOS_LOWCOST
+
+/*
+ * Definitions for IP precedence (also in ip_tos) (hopefully unused)
+ */
+#define        IPTOS_PREC_NETCONTROL           0xe0
+#define        IPTOS_PREC_INTERNETCONTROL      0xc0
+#define        IPTOS_PREC_CRITIC_ECP           0xa0
+#define        IPTOS_PREC_FLASHOVERRIDE        0x80
+#define        IPTOS_PREC_FLASH                0x60
+#define        IPTOS_PREC_IMMEDIATE            0x40
+#define        IPTOS_PREC_PRIORITY             0x20
+#define        IPTOS_PREC_ROUTINE              0x00
+
+/*
+ * Definitions for options.
+ */
+#define        IPOPT_COPIED(o)         ((o)&0x80)
+#define        IPOPT_CLASS(o)          ((o)&0x60)
+#define        IPOPT_NUMBER(o)         ((o)&0x1f)
+
+#define        IPOPT_CONTROL           0x00
+#define        IPOPT_RESERVED1         0x20
+#define        IPOPT_DEBMEAS           0x40
+#define        IPOPT_RESERVED2         0x60
+
+#define        IPOPT_EOL               0               /* end of option list */
+#define        IPOPT_NOP               1               /* no operation */
+
+#define        IPOPT_RR                7               /* record packet route */
+#define        IPOPT_TS                68              /* timestamp */
+#define        IPOPT_SECURITY          130             /* provide s,c,h,tcc */
+#define        IPOPT_LSRR              131             /* loose source route */
+#define        IPOPT_SATID             136             /* satnet id */
+#define        IPOPT_SSRR              137             /* strict source route */
+
+/*
+ * Offsets to fields in options other than EOL and NOP.
+ */
+#define        IPOPT_OPTVAL            0               /* option ID */
+#define        IPOPT_OLEN              1               /* option length */
+#define        IPOPT_OFFSET            2               /* offset within option */
+#define        IPOPT_MINOFF            4               /* min value of above */
+
+#define        MAX_IPOPTLEN            40
+
+/* flag bits for ipt_flg */
+#define        IPOPT_TS_TSONLY         0               /* timestamps only */
+#define        IPOPT_TS_TSANDADDR      1               /* timestamps and addresses */
+#define        IPOPT_TS_PRESPEC        3               /* specified modules only */
+
+/* bits for security (not byte swapped) */
+#define        IPOPT_SECUR_UNCLASS     0x0000
+#define        IPOPT_SECUR_CONFID      0xf135
+#define        IPOPT_SECUR_EFTO        0x789a
+#define        IPOPT_SECUR_MMMM        0xbc4d
+#define        IPOPT_SECUR_RESTR       0xaf13
+#define        IPOPT_SECUR_SECRET      0xd788
+#define        IPOPT_SECUR_TOPSECRET   0x6bc5
+
+/*
+ * Internet implementation parameters.
+ */
+#define        MAXTTL          255             /* maximum time to live (seconds) */
+#define        IPDEFTTL        64              /* default ttl, from RFC 1340 */
+#define        IPFRAGTTL       60              /* time to live for frags, slowhz */
+#define        IPTTLDEC        1               /* subtracted when forwarding */
+
+#define        IP_MSS          576             /* default maximum segment size */
+
+__END_DECLS
+
+#endif /* netinet/ip.h */
diff --git a/sysdeps/unix/sysv/linux/netinet/ip_fw.h b/sysdeps/unix/sysv/linux/netinet/ip_fw.h
new file mode 100644 (file)
index 0000000..3887ca8
--- /dev/null
@@ -0,0 +1,187 @@
+/* Copyright (C) 1991, 92, 93, 95, 96, 97 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* This header file was taken from linux (2.1.26) sources and modified
+ * to work under GNU LIBC 2.0.
+ */
+
+/*
+ * Copyright (c) 1993 Daniel Boulet
+ * Copyright (c) 1994 Ugen J.S.Antsilevich
+ *
+ * Redistribution and use in source forms, with and without modification,
+ * are permitted provided that this entire comment appears intact.
+ *
+ * Redistribution in binary form may occur without any restrictions.
+ * Obviously, it would be nice if you gave credit where credit is due
+ * but requiring it would be too onerous.
+ *
+ * This software is provided ``AS IS'' without any warranties of any kind.
+ */
+
+/*
+ *     Format of an IP firewall descriptor
+ *
+ *     src, dst, src_mask, dst_mask are always stored in network byte order.
+ *     flags and num_*_ports are stored in host byte order (of course).
+ *     Port numbers are stored in HOST byte order.
+ */
+#ifndef _NETINET_FW_H
+#define _NETINET_FW_H
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include <netinet/icmp.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/tcp.h>
+#include <netinet/udp.h>
+
+__BEGIN_DECLS
+
+struct ip_fw {
+  struct ip_fw  *fw_next;              /* Next firewall on chain */
+  struct in_addr fw_src, fw_dst;       /* Source and destination IP addr */
+  struct in_addr fw_smsk, fw_dmsk;     /* Mask for src and dest IP addr */
+  struct in_addr fw_via;               /* IP address of interface "via" */
+  void *fw_viadev;                     /* device of interface "via" */
+  u_int16_t fw_flg;                    /* Flags word */
+  u_int16_t fw_nsp, fw_ndp;             /* N'of src ports and # of dst ports */
+                                       /* in ports array (dst ports follow */
+                                       /* src ports; max of 10 ports in all;*/
+                                       /* count of 0 means match all ports) */
+#define IP_FW_MAX_PORTS        10              /* A reasonable maximum */
+  u_int16_t fw_pts[IP_FW_MAX_PORTS];    /* Array of port numbers to match */
+  u_int32_t fw_pcnt, fw_bcnt;          /* Packet and byte counters */
+  u_int8_t fw_tosand, fw_tosxor;       /* Revised packet priority */
+  char fw_vianame[IFNAMSIZ];           /* name of interface "via" */
+};
+
+/*
+ *     Values for "flags" field .
+ */
+
+#define IP_FW_F_ALL    0x0000  /* This is a universal packet firewall*/
+#define IP_FW_F_TCP    0x0001  /* This is a TCP packet firewall      */
+#define IP_FW_F_UDP    0x0002  /* This is a UDP packet firewall      */
+#define IP_FW_F_ICMP   0x0003  /* This is a ICMP packet firewall     */
+#define IP_FW_F_KIND   0x0003  /* Mask to isolate firewall kind      */
+#define IP_FW_F_ACCEPT 0x0004  /* This is an accept firewall (as     *
+                                *         opposed to a deny firewall)*
+                                *                                    */
+#define IP_FW_F_SRNG   0x0008  /* The first two src ports are a min  *
+                                * and max range (stored in host byte *
+                                * order).                            *
+                                *                                    */
+#define IP_FW_F_DRNG   0x0010  /* The first two dst ports are a min  *
+                                * and max range (stored in host byte *
+                                * order).                            *
+                                * (ports[0] <= port <= ports[1])     *
+                                *                                    */
+#define IP_FW_F_PRN    0x0020  /* In verbose mode print this firewall*/
+#define IP_FW_F_BIDIR  0x0040  /* For bidirectional firewalls        */
+#define IP_FW_F_TCPSYN 0x0080  /* For tcp packets-check SYN only     */
+#define IP_FW_F_ICMPRPL 0x0100 /* Send back icmp unreachable packet  */
+#define IP_FW_F_MASQ   0x0200  /* Masquerading                       */
+#define IP_FW_F_TCPACK 0x0400  /* For tcp-packets match if ACK is set*/
+#define IP_FW_F_REDIR  0x0800  /* Redirect to local port fw_pts[n]   */
+#define IP_FW_F_ACCTIN  0x1000 /* Account incoming packets only.     */
+#define IP_FW_F_ACCTOUT 0x2000 /* Account outgoing packets only.     */
+
+#define IP_FW_F_MASK   0x3FFF  /* All possible flag bits mask        */
+
+/*    
+ *     New IP firewall options for [gs]etsockopt at the RAW IP level.
+ *     Unlike BSD Linux inherits IP options so you don't have to use
+ *     a raw socket for this. Instead we check rights in the calls.
+ */     
+
+#define IP_FW_BASE_CTL         64      /* base for firewall socket options */
+
+#define IP_FW_COMMAND          0x00FF  /* mask for command without chain */
+#define IP_FW_TYPE             0x0300  /* mask for type (chain) */
+#define IP_FW_SHIFT            8       /* shift count for type (chain) */
+
+#define IP_FW_FWD              0
+#define IP_FW_IN               1
+#define IP_FW_OUT              2
+#define IP_FW_ACCT             3
+#define IP_FW_CHAINS           4       /* total number of ip_fw chains */
+
+#define IP_FW_INSERT           (IP_FW_BASE_CTL)
+#define IP_FW_APPEND           (IP_FW_BASE_CTL+1)
+#define IP_FW_DELETE           (IP_FW_BASE_CTL+2)
+#define IP_FW_FLUSH            (IP_FW_BASE_CTL+3)
+#define IP_FW_ZERO             (IP_FW_BASE_CTL+4)
+#define IP_FW_POLICY           (IP_FW_BASE_CTL+5)
+#define IP_FW_CHECK            (IP_FW_BASE_CTL+6)
+#define IP_FW_MASQ_TIMEOUTS    (IP_FW_BASE_CTL+7)
+
+#define IP_FW_INSERT_FWD       (IP_FW_INSERT | (IP_FW_FWD << IP_FW_SHIFT))
+#define IP_FW_APPEND_FWD       (IP_FW_APPEND | (IP_FW_FWD << IP_FW_SHIFT))
+#define IP_FW_DELETE_FWD       (IP_FW_DELETE | (IP_FW_FWD << IP_FW_SHIFT))
+#define IP_FW_FLUSH_FWD                (IP_FW_FLUSH  | (IP_FW_FWD << IP_FW_SHIFT))
+#define IP_FW_ZERO_FWD         (IP_FW_ZERO   | (IP_FW_FWD << IP_FW_SHIFT))
+#define IP_FW_POLICY_FWD       (IP_FW_POLICY | (IP_FW_FWD << IP_FW_SHIFT))
+#define IP_FW_CHECK_FWD                (IP_FW_CHECK  | (IP_FW_FWD << IP_FW_SHIFT))
+
+#define IP_FW_INSERT_IN                (IP_FW_INSERT | (IP_FW_IN << IP_FW_SHIFT))
+#define IP_FW_APPEND_IN                (IP_FW_APPEND | (IP_FW_IN << IP_FW_SHIFT))
+#define IP_FW_DELETE_IN                (IP_FW_DELETE | (IP_FW_IN << IP_FW_SHIFT))
+#define IP_FW_FLUSH_IN         (IP_FW_FLUSH  | (IP_FW_IN << IP_FW_SHIFT))
+#define IP_FW_ZERO_IN          (IP_FW_ZERO   | (IP_FW_IN << IP_FW_SHIFT))
+#define IP_FW_POLICY_IN                (IP_FW_POLICY | (IP_FW_IN << IP_FW_SHIFT))
+#define IP_FW_CHECK_IN         (IP_FW_CHECK  | (IP_FW_IN << IP_FW_SHIFT))
+
+#define IP_FW_INSERT_OUT       (IP_FW_INSERT | (IP_FW_OUT << IP_FW_SHIFT))
+#define IP_FW_APPEND_OUT       (IP_FW_APPEND | (IP_FW_OUT << IP_FW_SHIFT))
+#define IP_FW_DELETE_OUT       (IP_FW_DELETE | (IP_FW_OUT << IP_FW_SHIFT))
+#define IP_FW_FLUSH_OUT                (IP_FW_FLUSH  | (IP_FW_OUT << IP_FW_SHIFT))
+#define IP_FW_ZERO_OUT         (IP_FW_ZERO   | (IP_FW_OUT << IP_FW_SHIFT))
+#define IP_FW_POLICY_OUT       (IP_FW_POLICY | (IP_FW_OUT << IP_FW_SHIFT))
+#define IP_FW_CHECK_OUT                (IP_FW_CHECK  | (IP_FW_OUT << IP_FW_SHIFT))
+
+#define IP_ACCT_INSERT         (IP_FW_INSERT | (IP_FW_ACCT << IP_FW_SHIFT))
+#define IP_ACCT_APPEND         (IP_FW_APPEND | (IP_FW_ACCT << IP_FW_SHIFT))
+#define IP_ACCT_DELETE         (IP_FW_DELETE | (IP_FW_ACCT << IP_FW_SHIFT))
+#define IP_ACCT_FLUSH          (IP_FW_FLUSH  | (IP_FW_ACCT << IP_FW_SHIFT))
+#define IP_ACCT_ZERO           (IP_FW_ZERO   | (IP_FW_ACCT << IP_FW_SHIFT))
+
+struct ip_fwpkt
+{
+  struct iphdr fwp_iph;                        /* IP header */
+  union {
+    struct tcphdr fwp_tcph;            /* TCP header or */
+    struct udphdr fwp_udph;            /* UDP header */
+    struct icmphdr fwp_icmph;          /* ICMP header */
+  } fwp_protoh;
+  struct in_addr fwp_via;              /* interface address */
+  char fwp_vianame[IFNAMSIZ];          /* interface name */
+};
+
+/*
+ * timeouts for ip masquerading
+ */
+
+struct ip_fw_masq;
+  
+__END_DECLS
+
+#endif /* _NETINET_IP_FW_H */
diff --git a/sysdeps/unix/sysv/linux/netinet/ip_icmp.h b/sysdeps/unix/sysv/linux/netinet/ip_icmp.h
new file mode 100644 (file)
index 0000000..cb50193
--- /dev/null
@@ -0,0 +1,210 @@
+/* Copyright (C) 1991, 92, 93, 95, 96, 97 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef __NETINET_IP_ICMP_H
+#define __NETINET_IP_ICMP_H    1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+/*
+ * Copyright (c) 1982, 1986, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)ip_icmp.h   8.1 (Berkeley) 6/10/93
+ */
+
+#include <netinet/in.h>
+#include <netinet/ip.h>
+
+/*
+ * Internal of an ICMP Router Advertisement
+ */
+struct icmp_ra_addr {
+       u_int32_t ira_addr;
+       u_int32_t ira_preference;
+};
+
+struct icmp {
+  u_int8_t  icmp_type; /* type of message, see below */
+  u_int8_t  icmp_code; /* type sub code */
+  u_int16_t icmp_cksum;        /* ones complement checksum of struct */
+  union {
+    u_char ih_pptr;            /* ICMP_PARAMPROB */
+    struct in_addr ih_gwaddr;  /* gateway address */
+    struct ih_idseq {          /* echo datagram */     
+      u_int16_t icd_id;
+      u_int16_t icd_seq;
+    } ih_idseq;
+    u_int32_t ih_void;
+
+    /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
+    struct ih_pmtu {   
+      u_int16_t ipm_void;
+      u_int16_t ipm_nextmtu;
+    } ih_pmtu;
+
+    struct ih_rtradv {
+      u_int8_t irt_num_addrs;
+      u_int8_t irt_wpa;
+      u_int16_t irt_lifetime;
+    } ih_rtradv;
+  } icmp_hun;
+#define        icmp_pptr       icmp_hun.ih_pptr
+#define        icmp_gwaddr     icmp_hun.ih_gwaddr
+#define        icmp_id         icmp_hun.ih_idseq.icd_id
+#define        icmp_seq        icmp_hun.ih_idseq.icd_seq
+#define        icmp_void       icmp_hun.ih_void
+#define        icmp_pmvoid     icmp_hun.ih_pmtu.ipm_void
+#define        icmp_nextmtu    icmp_hun.ih_pmtu.ipm_nextmtu
+#define        icmp_num_addrs  icmp_hun.ih_rtradv.irt_num_addrs
+#define        icmp_wpa        icmp_hun.ih_rtradv.irt_wpa
+#define        icmp_lifetime   icmp_hun.ih_rtradv.irt_lifetime
+  union {
+    struct {
+      u_int32_t its_otime;
+      u_int32_t its_rtime;
+      u_int32_t its_ttime;
+    } id_ts;
+    struct {
+      struct ip idi_ip;
+      /* options and then 64 bits of data */
+    } id_ip;
+    struct icmp_ra_addr id_radv;
+    u_int32_t   id_mask;
+    u_int8_t    id_data[1];
+  } icmp_dun;
+#define        icmp_otime      icmp_dun.id_ts.its_otime
+#define        icmp_rtime      icmp_dun.id_ts.its_rtime
+#define        icmp_ttime      icmp_dun.id_ts.its_ttime
+#define        icmp_ip         icmp_dun.id_ip.idi_ip
+#define        icmp_radv       icmp_dun.id_radv
+#define        icmp_mask       icmp_dun.id_mask
+#define        icmp_data       icmp_dun.id_data
+};
+
+/*
+ * Lower bounds on packet lengths for various types.
+ * For the error advice packets must first insure that the
+ * packet is large enough to contain the returned ip header.
+ * Only then can we do the check to see if 64 bits of packet
+ * data have been returned, since we need to check the returned
+ * ip header length.
+ */
+#define        ICMP_MINLEN     8                               /* abs minimum */
+#define        ICMP_TSLEN      (8 + 3 * sizeof (n_time))       /* timestamp */
+#define        ICMP_MASKLEN    12                              /* address mask */
+#define        ICMP_ADVLENMIN  (8 + sizeof (struct ip) + 8)    /* min */
+#ifndef _IP_VHL
+#define        ICMP_ADVLEN(p)  (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
+       /* N.B.: must separately check that ip_hl >= 5 */
+#else
+#define        ICMP_ADVLEN(p)  (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8)
+       /* N.B.: must separately check that header length >= 5 */
+#endif
+
+/* Definition of type and code fields. */
+#define        ICMP_ECHOREPLY          0               /* echo reply */
+#define        ICMP_UNREACH            3               /* dest unreachable, codes: */
+#define        ICMP_SOURCEQUENCH       4               /* packet lost, slow down */
+#define        ICMP_REDIRECT           5               /* shorter route, codes: */
+#define        ICMP_ECHO               8               /* echo service */
+#define        ICMP_ROUTERADVERT       9               /* router advertisement */
+#define        ICMP_ROUTERSOLICIT      10              /* router solicitation */
+#define        ICMP_TIMXCEED           11              /* time exceeded, code: */
+#define        ICMP_PARAMPROB          12              /* ip header bad */
+#define        ICMP_TSTAMP             13              /* timestamp request */
+#define        ICMP_TSTAMPREPLY        14              /* timestamp reply */
+#define        ICMP_IREQ               15              /* information request */
+#define        ICMP_IREQREPLY          16              /* information reply */
+#define        ICMP_MASKREQ            17              /* address mask request */
+#define        ICMP_MASKREPLY          18              /* address mask reply */
+
+#define        ICMP_MAXTYPE            18
+
+/* UNREACH codes */
+#define        ICMP_UNREACH_NET                0       /* bad net */
+#define        ICMP_UNREACH_HOST               1       /* bad host */
+#define        ICMP_UNREACH_PROTOCOL           2       /* bad protocol */
+#define        ICMP_UNREACH_PORT               3       /* bad port */
+#define        ICMP_UNREACH_NEEDFRAG           4       /* IP_DF caused drop */
+#define        ICMP_UNREACH_SRCFAIL            5       /* src route failed */
+#define        ICMP_UNREACH_NET_UNKNOWN        6       /* unknown net */
+#define        ICMP_UNREACH_HOST_UNKNOWN       7       /* unknown host */
+#define        ICMP_UNREACH_ISOLATED           8       /* src host isolated */
+#define        ICMP_UNREACH_NET_PROHIB         9       /* net denied */
+#define        ICMP_UNREACH_HOST_PROHIB        10      /* host denied */
+#define        ICMP_UNREACH_TOSNET             11      /* bad tos for net */
+#define        ICMP_UNREACH_TOSHOST            12      /* bad tos for host */
+#define        ICMP_UNREACH_FILTER_PROHIB      13      /* admin prohib */
+#define        ICMP_UNREACH_HOST_PRECEDENCE    14      /* host prec vio. */
+#define        ICMP_UNREACH_PRECEDENCE_CUTOFF  15      /* prec cutoff */
+
+/* REDIRECT codes */
+#define        ICMP_REDIRECT_NET       0               /* for network */
+#define        ICMP_REDIRECT_HOST      1               /* for host */
+#define        ICMP_REDIRECT_TOSNET    2               /* for tos and net */
+#define        ICMP_REDIRECT_TOSHOST   3               /* for tos and host */
+
+/* TIMEXCEED codes */
+#define        ICMP_TIMXCEED_INTRANS   0               /* ttl==0 in transit */
+#define        ICMP_TIMXCEED_REASS     1               /* ttl==0 in reass */
+
+/* PARAMPROB code */
+#define        ICMP_PARAMPROB_OPTABSENT 1              /* req. opt. absent */
+
+#define        ICMP_INFOTYPE(type) \
+       ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
+       (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
+       (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
+       (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
+       (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
+
+__END_DECLS
+
+#endif /* netinet/ip_icmp.h */
diff --git a/sysdeps/unix/sysv/linux/netinet/tcp.h b/sysdeps/unix/sysv/linux/netinet/tcp.h
new file mode 100644 (file)
index 0000000..b7bf085
--- /dev/null
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 1982, 1986, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)tcp.h       8.1 (Berkeley) 6/10/93
+ */
+
+#ifndef _NETINET_TCP_H
+#define _NETINET_TCP_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+#ifdef __FAVOR_BSD
+typedef        u_int32_t       tcp_seq;
+/*
+ * TCP header.
+ * Per RFC 793, September, 1981.
+ */
+struct tcphdr {
+       u_int16_t       th_sport;               /* source port */
+       u_int16_t       th_dport;               /* destination port */
+       tcp_seq th_seq;                 /* sequence number */
+       tcp_seq th_ack;                 /* acknowledgement number */
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+       u_int8_t        th_x2:4,                /* (unused) */
+               th_off:4;               /* data offset */
+#endif
+#if __BYTE_ORDER == __BIG_ENDIAN
+       u_int8_t        th_off:4,               /* data offset */
+               th_x2:4;                /* (unused) */
+#endif
+       u_int8_t        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_int16_t       th_win;                 /* window */
+       u_int16_t       th_sum;                 /* checksum */
+       u_int16_t       th_urp;                 /* urgent pointer */
+};
+
+#else /* !__FAVOR_BSD */
+struct tcphdr {
+       u_int16_t       source;
+       u_int16_t       dest;
+       u_int32_t       seq;
+       u_int32_t       ack_seq;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+       u_int16_t       res1:4,
+               doff:4,
+               fin:1,
+               syn:1,
+               rst:1,
+               psh:1,
+               ack:1,
+               urg:1,
+               res2:2;
+#elif __BYTE_ORDER == __BIG_ENDIAN
+       u_int16_t       doff:4,
+               res1:4,
+               res2:2,
+               urg:1,
+               ack:1,
+               psh:1,
+               rst:1,
+               syn:1,
+               fin:1;
+#else
+#error "Adjust your <bytesex.h> defines"
+#endif 
+       u_int16_t       window;
+       u_int16_t       check;
+       u_int16_t       urg_ptr;
+};
+#endif /* __FAVOR_BSD */
+
+enum {
+  TCP_ESTABLISHED = 1,
+  TCP_SYN_SENT,
+  TCP_SYN_RECV,
+  TCP_FIN_WAIT1,
+  TCP_FIN_WAIT2,
+  TCP_TIME_WAIT,
+  TCP_CLOSE,
+  TCP_CLOSE_WAIT,
+  TCP_LAST_ACK,
+  TCP_LISTEN,
+  TCP_CLOSING   /* now a valid state */
+};
+
+#define        TCPOPT_EOL              0
+#define        TCPOPT_NOP              1
+#define        TCPOPT_MAXSEG           2
+#define    TCPOLEN_MAXSEG              4
+#define TCPOPT_WINDOW          3
+#define    TCPOLEN_WINDOW              3
+#define TCPOPT_SACK_PERMITTED  4               /* Experimental */
+#define    TCPOLEN_SACK_PERMITTED      2
+#define TCPOPT_SACK            5               /* Experimental */
+#define TCPOPT_TIMESTAMP       8
+#define    TCPOLEN_TIMESTAMP           10
+#define    TCPOLEN_TSTAMP_APPA         (TCPOLEN_TIMESTAMP+2) /* appendix A */
+
+#define TCPOPT_TSTAMP_HDR      \
+    (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
+
+/*
+ * Default maximum segment size for TCP.
+ * With an IP MSS of 576, this is 536,
+ * but 512 is probably more convenient.
+ * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
+ */
+#define        TCP_MSS 512
+
+#define        TCP_MAXWIN      65535   /* largest value for (unscaled) window */
+
+#define TCP_MAX_WINSHIFT       14      /* maximum window shift */
+
+/*
+ * 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 */
+
+#define SOL_TCP                6       /* TCP level */
+
+__END_DECLS
+
+#endif /* netinet/tcp.h */
index b088838ccb1beff6012605c1cc52037e24f718df..9ee66f0fce0697a7b1a7c58ca2e7bca2ac4f9953 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 95, 96, 97 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
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _NETINET_UDP_H
-#define _NETINET_UDP_H 1
+/*
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
 
-#include <sys/types.h>
+#ifndef __NETINET_UDP_H
+#define __NETINET_UDP_H    1
 
-/* The Internet RFC 768 specifies this format for the UDP protocol.  */
-struct udphdr
-  {
-    u_short uh_sport;          /* Source port.  */
-    u_short uh_dport;          /* Destination port.  */
-    u_short uh_ulen;           /* UDP length.  */
-    u_short uh_sum;            /* UDP checksum.  */
-  };
+#include <sys/cdefs.h>
+#include <sys/types.h>
 
-#define SOL_UDP                17      /* UDP level.  */
+__BEGIN_DECLS
+
+/* UDP header as specified by RFC 768, August 1980. */
+#ifdef __FAVOR_BSD
+struct udphdr {
+         u_int16_t uh_sport;           /* source port */
+         u_int16_t uh_dport;           /* destination port */
+         u_int16_t uh_ulen;            /* udp length */
+         u_int16_t uh_sum;             /* udp checksum */
+};
+#else
+
+struct udphdr {
+  u_int16_t    source;
+  u_int16_t    dest;
+  u_int16_t    len;
+  u_int16_t    check;
+};
+#endif
+
+#define SOL_UDP            17      /* sockopt level for UDP */
+
+__END_DECLS
 
 #endif /* netinet/udp.h */
diff --git a/sysdeps/unix/sysv/linux/netipx/ipx.h b/sysdeps/unix/sysv/linux/netipx/ipx.h
new file mode 100644 (file)
index 0000000..170dfdf
--- /dev/null
@@ -0,0 +1,28 @@
+/* Copyright (C) 1991, 92, 93, 95, 96, 97 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 Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef __NETIPX_IPX_H
+#define __NETIPX_IPX_H 1
+
+#include <asm/types.h>
+#include <linux/ipx.h>
+
+#define SOL_IPX    256          /* sockopt level */
+#define IPX_TYPE   1
+
+#endif /* netipx/ipx.h */
index 8783b2767efb58f255d8ba93f7775e7fb409570d..4d249aaaaac0578796fc6d6909533936cfde0845 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 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
 /* Disable reboot using Ctrl-Alt-Delete keystroke.  */
 #define RB_DISABLE_CAD 0
 
+__BEGIN_DECLS
 
 /* Reboot or halt the system.  */
 extern int reboot __P ((int __howto));
 
+__END_DECLS
+
 #endif /* _SYS_REBOOT_H */