summaryrefslogtreecommitdiff
path: root/include/arpa
diff options
context:
space:
mode:
Diffstat (limited to 'include/arpa')
-rw-r--r--include/arpa/ftp.h109
-rw-r--r--include/arpa/inet.h101
-rw-r--r--include/arpa/nameser.h64
-rw-r--r--include/arpa/telnet.h11
-rw-r--r--include/arpa/tftp.h4
5 files changed, 220 insertions, 69 deletions
diff --git a/include/arpa/ftp.h b/include/arpa/ftp.h
new file mode 100644
index 000000000..ac864aa70
--- /dev/null
+++ b/include/arpa/ftp.h
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 1983, 1989, 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.
+ *
+ * @(#)ftp.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _ARPA_FTP_H
+#define _ARPA_FTP_H 1
+
+/* Definitions for FTP; see RFC-765. */
+
+/*
+ * Reply codes.
+ */
+#define PRELIM 1 /* positive preliminary */
+#define COMPLETE 2 /* positive completion */
+#define CONTINUE 3 /* positive intermediate */
+#define TRANSIENT 4 /* transient negative completion */
+#define ERROR 5 /* permanent negative completion */
+
+/*
+ * Type codes
+ */
+#define TYPE_A 1 /* ASCII */
+#define TYPE_E 2 /* EBCDIC */
+#define TYPE_I 3 /* image */
+#define TYPE_L 4 /* local byte size */
+
+#ifdef FTP_NAMES
+char *typenames[] = {"0", "ASCII", "EBCDIC", "Image", "Local" };
+#endif
+
+/*
+ * Form codes
+ */
+#define FORM_N 1 /* non-print */
+#define FORM_T 2 /* telnet format effectors */
+#define FORM_C 3 /* carriage control (ASA) */
+#ifdef FTP_NAMES
+char *formnames[] = {"0", "Nonprint", "Telnet", "Carriage-control" };
+#endif
+
+/*
+ * Structure codes
+ */
+#define STRU_F 1 /* file (no record structure) */
+#define STRU_R 2 /* record structure */
+#define STRU_P 3 /* page structure */
+#ifdef FTP_NAMES
+char *strunames[] = {"0", "File", "Record", "Page" };
+#endif
+
+/*
+ * Mode types
+ */
+#define MODE_S 1 /* stream */
+#define MODE_B 2 /* block */
+#define MODE_C 3 /* compressed */
+#ifdef FTP_NAMES
+char *modenames[] = {"0", "Stream", "Block", "Compressed" };
+#endif
+
+/*
+ * Record Tokens
+ */
+#define REC_ESC '\377' /* Record-mode Escape */
+#define REC_EOR '\001' /* Record-mode End-of-Record */
+#define REC_EOF '\002' /* Record-mode End-of-File */
+
+/*
+ * Block Header
+ */
+#define BLK_EOR 0x80 /* Block is End-of-Record */
+#define BLK_EOF 0x40 /* Block is End-of-File */
+#define BLK_ERRORS 0x20 /* Block is suspected of containing errors */
+#define BLK_RESTART 0x10 /* Block is Restart Marker */
+
+#define BLK_BYTECOUNT 2 /* Bytes in this block */
+
+#endif /* arpa/ftp.h */
diff --git a/include/arpa/inet.h b/include/arpa/inet.h
index cf4cd3275..e34c4726a 100644
--- a/include/arpa/inet.h
+++ b/include/arpa/inet.h
@@ -1,12 +1,95 @@
-#ifndef __ARPA_INET_H
-#define __ARPA_INET_H
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-#include <netinet/in.h>
+ 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.
-int inet_aton(const char *cp, struct in_addr *inp);
-
-unsigned long int inet_addr(const char *cp);
+ 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.
-char *inet_ntoa(struct in_addr in);
-
-#endif
+ 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 _ARPA_INET_H
+#define _ARPA_INET_H 1
+
+#include <features.h>
+
+#include <sys/types.h>
+#include <netinet/in.h> /* To define `struct in_addr'. */
+
+__BEGIN_DECLS
+
+/* Convert Internet host address from numbers-and-dots notation in CP
+ into binary data in network byte order. */
+extern u_int32_t inet_addr __P ((__const char *__cp));
+
+/* Convert Internet host address from numbers-and-dots notation in CP
+ into binary data and store the result in the structure INP. */
+extern int inet_aton __P ((__const char *__cp, struct in_addr *__inp));
+
+/* Return the local host address part of the Internet address in IN. */
+extern u_int32_t inet_lnaof __P ((struct in_addr __in));
+
+/* Make Internet host address in network byte order by combining the
+ network number NET with the local address HOST. */
+extern struct in_addr inet_makeaddr __P ((u_int32_t __net, u_int32_t __host));
+
+/* Format a network number NET into presentation format and place result
+ in buffer starting at BUF with length of LEN bytes. */
+extern char *inet_neta __P ((u_int32_t __net, char *__buf, size_t __len));
+
+/* Return network number part of the Internet address IN. */
+extern u_int32_t inet_netof __P ((struct in_addr __in));
+
+/* Extract the network number in network byte order from the address
+ in numbers-and-dots natation starting at CP. */
+extern u_int32_t inet_network __P ((__const char *__cp));
+
+/* Convert network number for interface type AF in buffer starting at
+ CP to presentation format. The result will specifiy BITS bits of
+ the number. */
+extern char *inet_net_ntop __P ((int __af, __const void *__cp, int __bits,
+ char *__buf, size_t __len));
+
+/* Convert network number for interface type AF from presentation in
+ buffer starting at CP to network format and store result int
+ buffer starting at BUF of size LEN. */
+extern int inet_net_pton __P ((int __af, __const char *__cp,
+ void *__buf, size_t __len));
+
+/* Convert Internet number in IN to ASCII representation. The return value
+ is a pointer to an internal array containing the string. */
+extern char *inet_ntoa __P ((struct in_addr __in));
+
+/* Convert from presentation format of an Internet number in buffer
+ starting at CP to the binary network format and store result for
+ interface type AF in buffer starting at BUF. */
+extern int inet_pton __P ((int __af, __const char *__cp, void *__buf));
+
+/* Convert a Internet address in binary network format for interface
+ type AF in buffer starting at CP to presentation form and place
+ result in buffer of length LEN astarting at BUF. */
+extern __const char *inet_ntop __P ((int __af, __const void *__cp,
+ char *__buf, size_t __len));
+
+/* Convert ASCII representation in hexadecimal form of the Internet
+ address to binary form and place result in buffer of length LEN
+ starting at BUF. */
+extern unsigned int inet_nsap_addr __P ((__const char *__cp,
+ unsigned char *__buf, int __len));
+
+/* Convert internet address in binary form in LEN bytes starting at CP
+ a presentation form and place result in BUF. */
+extern char *inet_nsap_ntoa __P ((int __len, __const unsigned char *__cp,
+ char *__buf));
+
+__END_DECLS
+
+#endif /* arpa/inet.h */
diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
index e88ad8226..4a8ef67c7 100644
--- a/include/arpa/nameser.h
+++ b/include/arpa/nameser.h
@@ -77,23 +77,15 @@
/*
* @(#)nameser.h 8.1 (Berkeley) 6/2/93
- * $Id: nameser.h,v 1.2 2000/05/14 06:07:30 erik Exp $
+ * $Id: nameser.h,v 1.3 2000/07/09 06:39:14 andersen Exp $
*/
-#ifndef _NAMESER_H_
-#define _NAMESER_H_
+#ifndef _ARPA_NAMESER_H
+#define _ARPA_NAMESER_H 1
+#include <features.h>
#include <sys/param.h>
-#if (!defined(BSD)) || (BSD < 199306)
-# include <sys/bitypes.h>
-#else
-# include <sys/types.h>
-#endif
-#include <sys/cdefs.h>
-
-#ifdef _AUX_SOURCE
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
/*
* revision information. this is the release date in YYYYMMDD format.
@@ -254,46 +246,10 @@
#define CONV_BADCKSUM (-3)
#define CONV_BADBUFLEN (-4)
-#ifndef BYTE_ORDER
-#if (BSD >= 199103)
-# include <machine/endian.h>
-#else
-#ifdef __linux__
-# include <endian.h>
-#else
-#define LITTLE_ENDIAN 1234 /* least-significant byte first (vax, pc) */
-#define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */
-#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp)*/
+/* glibc always has byte order info in <endian.h> */
+#include <endian.h>
-#if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \
- defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \
- defined(__alpha__) || defined(__alpha)
-#define BYTE_ORDER LITTLE_ENDIAN
-#endif
-
-#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \
- defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \
- defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\
- defined(apollo) || defined(__convex__) || defined(_CRAY) || \
- defined(__hppa) || defined(__hp9000) || \
- defined(__hp9000s300) || defined(__hp9000s700) || \
- defined (BIT_ZERO_ON_LEFT) || defined(m68k)
-#define BYTE_ORDER BIG_ENDIAN
-#endif
-#endif /* __linux__ */
-#endif /* BSD */
-#endif /* BYTE_ORDER */
-
-#if !defined(BYTE_ORDER) || \
- (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \
- BYTE_ORDER != PDP_ENDIAN)
- /* you must determine what the correct bit order is for
- * your compiler - the next line is an intentional error
- * which will force your compiles to bomb until you fix
- * the above macros.
- */
- error "Undefined or invalid BYTE_ORDER";
-#endif
+__BEGIN_DECLS
/*
* Structure for query header. The order of the fields is machine- and
@@ -389,4 +345,6 @@ extern u_int32_t _getlong __P((const u_char *));
(cp) += INT32SZ; \
}
-#endif /* !_NAMESER_H_ */
+__END_DECLS
+
+#endif /* arpa/nameser.h */
diff --git a/include/arpa/telnet.h b/include/arpa/telnet.h
index 25085b89a..3309e5d72 100644
--- a/include/arpa/telnet.h
+++ b/include/arpa/telnet.h
@@ -34,7 +34,7 @@
*/
#ifndef _ARPA_TELNET_H
-#define _ARPA_TELNET_H
+#define _ARPA_TELNET_H 1
/*
* Definitions for the TELNET protocol.
@@ -96,7 +96,7 @@ extern char *telcmds[];
#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
-#define TELOPT_XASCII 17 /* extended ascic character set */
+#define TELOPT_XASCII 17 /* extended ascii character set */
#define TELOPT_LOGOUT 18 /* force logout */
#define TELOPT_BM 19 /* byte macro */
#define TELOPT_DET 20 /* data entry terminal */
@@ -200,7 +200,7 @@ char *telopts[NTELOPTS+1] = {
#define NSLC 18
/*
- * For backwards compatability, we define SLC_NAMES to be the
+ * For backwards compatibility, we define SLC_NAMES to be the
* list of names if SLC_NAMES is not defined.
*/
#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
@@ -237,7 +237,7 @@ extern char *slc_names[];
#define NEW_ENV_VAR 0
#define NEW_ENV_VALUE 1
#define ENV_ESC 2
-#define ENV_USERVAR 3
+#define ENV_USERVAR 3
/*
* AUTHENTICATION suboptions
@@ -316,4 +316,5 @@ extern char *enctype_names[];
#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
#define ENCTYPE_NAME(x) enctype_names[x]
-#endif /* _ARPA_TELNET_H */
+
+#endif /* arpa/telnet.h */
diff --git a/include/arpa/tftp.h b/include/arpa/tftp.h
index 0904407c7..69187da08 100644
--- a/include/arpa/tftp.h
+++ b/include/arpa/tftp.h
@@ -56,9 +56,9 @@ struct tftphdr {
unsigned short tu_block; /* block # */
short tu_code; /* error code */
char tu_stuff[1]; /* request packet stuff */
- } th_u;
+ } __attribute__ ((__packed__)) th_u;
char th_data[1]; /* data or error string */
-};
+} __attribute__ ((__packed__));
#define th_block th_u.tu_block
#define th_code th_u.tu_code