o Move NTOHL() and associated macros into <sys/param.h>. These are
deprecated in favor of the POSIX-defined lowercase variants. o Change all occurrences of NTOHL() and associated marcros in the source tree to use the lowercase function variants. o Add missing license bits to sparc64's <machine/endian.h>. Approved by: jake o Clean up <machine/endian.h> files. o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>. o Remove prototypes for non-existent bswapXX() functions. o Include <machine/endian.h> in <arpa/inet.h> to define the POSIX-required ntohl() family of functions. o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>, and <sys/param.h>. o Prepend underscores to the ntohl() family to help deal with complexities associated with having MD (asm and inline) versions, and having to prevent exposure of these functions in other headers that happen to make use of endian-specific defines. o Create weak aliases to the canonical function name to help deal with third-party software forgetting to include an appropriate header. o Remove some now unneeded pollution from <sys/types.h>. o Add missing <arpa/inet.h> includes in userland. Tested on: alpha, i386 Reviewed by: bde, jake, tmm
This commit is contained in:
parent
3e1ce344ba
commit
fd8e4ebc8c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=90868
@ -48,9 +48,10 @@ static const char rcsid[] =
|
|||||||
"$FreeBSD$";
|
"$FreeBSD$";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
# include <sys/param.h>
|
|
||||||
# include <sys/stat.h>
|
# include <sys/stat.h>
|
||||||
|
|
||||||
|
# include <arpa/inet.h>
|
||||||
|
|
||||||
# include <dirent.h>
|
# include <dirent.h>
|
||||||
# include <fcntl.h>
|
# include <fcntl.h>
|
||||||
# include <assert.h>
|
# include <assert.h>
|
||||||
|
@ -50,6 +50,7 @@ static const char rcsid[] =
|
|||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
# include <sys/param.h>
|
# include <sys/param.h>
|
||||||
|
# include <arpa/inet.h>
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
# include <ctype.h>
|
# include <ctype.h>
|
||||||
|
@ -63,6 +63,7 @@ static const char rcsid[] =
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
# include <sys/param.h>
|
# include <sys/param.h>
|
||||||
|
# include <arpa/inet.h>
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
# include <ctype.h>
|
# include <ctype.h>
|
||||||
# include <string.h>
|
# include <string.h>
|
||||||
|
@ -47,9 +47,7 @@
|
|||||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||||
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*
|
||||||
|
|
||||||
/*
|
|
||||||
* @(#)inet.h 8.1 (Berkeley) 6/2/93
|
* @(#)inet.h 8.1 (Berkeley) 6/2/93
|
||||||
* From: Id: inet.h,v 8.5 1997/01/29 08:48:09 vixie Exp $
|
* From: Id: inet.h,v 8.5 1997/01/29 08:48:09 vixie Exp $
|
||||||
* $FreeBSD$
|
* $FreeBSD$
|
||||||
@ -63,6 +61,9 @@
|
|||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#include <machine/ansi.h>
|
#include <machine/ansi.h>
|
||||||
|
|
||||||
|
/* Required for byteorder(3) functions. */
|
||||||
|
#include <machine/endian.h>
|
||||||
|
|
||||||
#ifndef _IN_ADDR_T_DECLARED_
|
#ifndef _IN_ADDR_T_DECLARED_
|
||||||
typedef __uint32_t in_addr_t;
|
typedef __uint32_t in_addr_t;
|
||||||
#define _IN_ADDR_T_DECLARED_
|
#define _IN_ADDR_T_DECLARED_
|
||||||
@ -114,14 +115,23 @@ struct in_addr {
|
|||||||
#define inet_nsap_ntoa __inet_nsap_ntoa
|
#define inet_nsap_ntoa __inet_nsap_ntoa
|
||||||
#endif /* !_POSIX_SOURCE */
|
#endif /* !_POSIX_SOURCE */
|
||||||
|
|
||||||
|
#ifndef _BYTEORDER_FUNC_DEFINED
|
||||||
|
#define _BYTEORDER_FUNC_DEFINED
|
||||||
|
#define htonl(x) __htonl(x)
|
||||||
|
#define htons(x) __htons(x)
|
||||||
|
#define ntohl(x) __ntohl(x)
|
||||||
|
#define ntohs(x) __ntohs(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
__uint32_t htonl(__uint32_t);
|
||||||
|
__uint16_t htons(__uint16_t);
|
||||||
in_addr_t inet_addr __P((const char *));
|
in_addr_t inet_addr __P((const char *));
|
||||||
char *inet_ntoa __P((struct in_addr));
|
char *inet_ntoa __P((struct in_addr));
|
||||||
const char *inet_ntop __P((int, const void *, char *, socklen_t));
|
const char *inet_ntop __P((int, const void *, char *, socklen_t));
|
||||||
int inet_pton __P((int, const char *, void *));
|
int inet_pton __P((int, const char *, void *));
|
||||||
/*
|
__uint32_t ntohl(__uint32_t);
|
||||||
* XXX missing: ntohl() family.
|
__uint16_t ntohs(__uint16_t);
|
||||||
*/
|
|
||||||
|
|
||||||
/* Nonstandard functions. */
|
/* Nonstandard functions. */
|
||||||
#ifndef _POSIX_SOURCE
|
#ifndef _POSIX_SOURCE
|
||||||
|
@ -261,13 +261,13 @@ struct xdr_discrim {
|
|||||||
* N.B. and frozen for all time: each data type here uses 4 bytes
|
* N.B. and frozen for all time: each data type here uses 4 bytes
|
||||||
* of external representation.
|
* of external representation.
|
||||||
*/
|
*/
|
||||||
#define IXDR_GET_INT32(buf) ((int32_t)ntohl((u_int32_t)*(buf)++))
|
#define IXDR_GET_INT32(buf) ((int32_t)__ntohl((u_int32_t)*(buf)++))
|
||||||
#define IXDR_PUT_INT32(buf, v) (*(buf)++ =(int32_t)htonl((u_int32_t)v))
|
#define IXDR_PUT_INT32(buf, v) (*(buf)++ =(int32_t)__htonl((u_int32_t)v))
|
||||||
#define IXDR_GET_U_INT32(buf) ((u_int32_t)IXDR_GET_INT32(buf))
|
#define IXDR_GET_U_INT32(buf) ((u_int32_t)IXDR_GET_INT32(buf))
|
||||||
#define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_INT32((buf), ((int32_t)(v)))
|
#define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_INT32((buf), ((int32_t)(v)))
|
||||||
|
|
||||||
#define IXDR_GET_LONG(buf) ((long)ntohl((u_int32_t)*(buf)++))
|
#define IXDR_GET_LONG(buf) ((long)__ntohl((u_int32_t)*(buf)++))
|
||||||
#define IXDR_PUT_LONG(buf, v) (*(buf)++ =(int32_t)htonl((u_int32_t)v))
|
#define IXDR_PUT_LONG(buf, v) (*(buf)++ =(int32_t)__htonl((u_int32_t)v))
|
||||||
|
|
||||||
#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf))
|
#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf))
|
||||||
#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf))
|
#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf))
|
||||||
|
@ -25,12 +25,14 @@
|
|||||||
*
|
*
|
||||||
* any improvements or extensions that they make and grant Carnegie the
|
* any improvements or extensions that they make and grant Carnegie the
|
||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
|
*
|
||||||
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
#ifndef NAME
|
#if !defined(ALIAS) || !defined(NAME)
|
||||||
#define NAME byte_swap_2
|
#error ALIAS or NAME not defined
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -38,6 +40,7 @@
|
|||||||
*
|
*
|
||||||
* Argument is an unsigned 2-byte integer (u_int16_t).
|
* Argument is an unsigned 2-byte integer (u_int16_t).
|
||||||
*/
|
*/
|
||||||
|
XLEAF(ALIAS, 1)
|
||||||
LEAF(NAME, 1) /* a0 contains 0x0123 */
|
LEAF(NAME, 1) /* a0 contains 0x0123 */
|
||||||
extbl a0, 0, t0 /* t0 = 0x 23 */
|
extbl a0, 0, t0 /* t0 = 0x 23 */
|
||||||
extbl a0, 1, t1 /* t1 = 0x 01 */
|
extbl a0, 1, t1 /* t1 = 0x 01 */
|
||||||
|
@ -25,12 +25,14 @@
|
|||||||
*
|
*
|
||||||
* any improvements or extensions that they make and grant Carnegie the
|
* any improvements or extensions that they make and grant Carnegie the
|
||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
|
*
|
||||||
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
#ifndef NAME
|
#if !defined(ALIAS) || !defined(NAME)
|
||||||
#define NAME byte_swap_4
|
#error ALIAS or NAME not defined
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -38,6 +40,7 @@
|
|||||||
*
|
*
|
||||||
* Argument is an unsigned 4-byte integer (u_int32_t).
|
* Argument is an unsigned 4-byte integer (u_int32_t).
|
||||||
*/
|
*/
|
||||||
|
XLEAF(ALIAS, 1)
|
||||||
LEAF(NAME, 1) /* a0 contains 0x01234567 */
|
LEAF(NAME, 1) /* a0 contains 0x01234567 */
|
||||||
extbl a0, 0, t0 /* t0 = 0x 67 */
|
extbl a0, 0, t0 /* t0 = 0x 67 */
|
||||||
extbl a0, 1, t1 /* t1 = 0x 45 */
|
extbl a0, 1, t1 /* t1 = 0x 45 */
|
||||||
|
@ -25,8 +25,11 @@
|
|||||||
*
|
*
|
||||||
* any improvements or extensions that they make and grant Carnegie the
|
* any improvements or extensions that they make and grant Carnegie the
|
||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
|
*
|
||||||
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NAME htonl
|
#define ALIAS htonl
|
||||||
|
#define NAME __htonl
|
||||||
|
|
||||||
#include "byte_swap_4.S"
|
#include "byte_swap_4.S"
|
||||||
|
@ -25,8 +25,11 @@
|
|||||||
*
|
*
|
||||||
* any improvements or extensions that they make and grant Carnegie the
|
* any improvements or extensions that they make and grant Carnegie the
|
||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
|
*
|
||||||
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NAME htons
|
#define ALIAS htons
|
||||||
|
#define NAME __htons
|
||||||
|
|
||||||
#include "byte_swap_2.S"
|
#include "byte_swap_2.S"
|
||||||
|
@ -25,8 +25,11 @@
|
|||||||
*
|
*
|
||||||
* any improvements or extensions that they make and grant Carnegie the
|
* any improvements or extensions that they make and grant Carnegie the
|
||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
|
*
|
||||||
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NAME ntohl
|
#define ALIAS ntohl
|
||||||
|
#define NAME __ntohl
|
||||||
|
|
||||||
#include "byte_swap_4.S"
|
#include "byte_swap_4.S"
|
||||||
|
@ -25,8 +25,11 @@
|
|||||||
*
|
*
|
||||||
* any improvements or extensions that they make and grant Carnegie the
|
* any improvements or extensions that they make and grant Carnegie the
|
||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
|
*
|
||||||
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NAME ntohs
|
#define ALIAS ntohs
|
||||||
|
#define NAME __ntohs
|
||||||
|
|
||||||
#include "byte_swap_2.S"
|
#include "byte_swap_2.S"
|
||||||
|
@ -43,7 +43,9 @@
|
|||||||
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
ENTRY(htonl)
|
.weak CNAME(htonl)
|
||||||
|
.set CNAME(htonl),CNAME(__htonl)
|
||||||
|
ENTRY(__htonl)
|
||||||
movl 4(%esp),%eax
|
movl 4(%esp),%eax
|
||||||
xchgb %al,%ah
|
xchgb %al,%ah
|
||||||
roll $16,%eax
|
roll $16,%eax
|
||||||
|
@ -43,7 +43,9 @@
|
|||||||
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
ENTRY(htons)
|
.weak CNAME(htons)
|
||||||
|
.set CNAME(htons),CNAME(__htons)
|
||||||
|
ENTRY(__htons)
|
||||||
movzwl 4(%esp),%eax
|
movzwl 4(%esp),%eax
|
||||||
xchgb %al,%ah
|
xchgb %al,%ah
|
||||||
ret
|
ret
|
||||||
|
@ -43,7 +43,9 @@
|
|||||||
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
ENTRY(ntohl)
|
.weak CNAME(ntohl)
|
||||||
|
.set CNAME(ntohl),CNAME(__ntohl)
|
||||||
|
ENTRY(__ntohl)
|
||||||
movl 4(%esp),%eax
|
movl 4(%esp),%eax
|
||||||
xchgb %al,%ah
|
xchgb %al,%ah
|
||||||
roll $16,%eax
|
roll $16,%eax
|
||||||
|
@ -43,7 +43,9 @@
|
|||||||
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
ENTRY(ntohs)
|
.weak CNAME(ntohs)
|
||||||
|
.set CNAME(ntohs),CNAME(__ntohs)
|
||||||
|
ENTRY(__ntohs)
|
||||||
movzwl 4(%esp),%eax
|
movzwl 4(%esp),%eax
|
||||||
xchgb %al,%ah
|
xchgb %al,%ah
|
||||||
ret
|
ret
|
||||||
|
@ -43,7 +43,9 @@
|
|||||||
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
ENTRY(htonl)
|
.weak CNAME(htonl)
|
||||||
|
.set CNAME(htonl),CNAME(__htonl)
|
||||||
|
ENTRY(__htonl)
|
||||||
movl 4(%esp),%eax
|
movl 4(%esp),%eax
|
||||||
xchgb %al,%ah
|
xchgb %al,%ah
|
||||||
roll $16,%eax
|
roll $16,%eax
|
||||||
|
@ -43,7 +43,9 @@
|
|||||||
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
ENTRY(htons)
|
.weak CNAME(htons)
|
||||||
|
.set CNAME(htons),CNAME(__htons)
|
||||||
|
ENTRY(__htons)
|
||||||
movzwl 4(%esp),%eax
|
movzwl 4(%esp),%eax
|
||||||
xchgb %al,%ah
|
xchgb %al,%ah
|
||||||
ret
|
ret
|
||||||
|
@ -43,7 +43,9 @@
|
|||||||
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
ENTRY(ntohl)
|
.weak CNAME(ntohl)
|
||||||
|
.set CNAME(ntohl),CNAME(__ntohl)
|
||||||
|
ENTRY(__ntohl)
|
||||||
movl 4(%esp),%eax
|
movl 4(%esp),%eax
|
||||||
xchgb %al,%ah
|
xchgb %al,%ah
|
||||||
roll $16,%eax
|
roll $16,%eax
|
||||||
|
@ -43,7 +43,9 @@
|
|||||||
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
ENTRY(ntohs)
|
.weak CNAME(ntohs)
|
||||||
|
.set CNAME(ntohs),CNAME(__ntohs)
|
||||||
|
ENTRY(__ntohs)
|
||||||
movzwl 4(%esp),%eax
|
movzwl 4(%esp),%eax
|
||||||
xchgb %al,%ah
|
xchgb %al,%ah
|
||||||
ret
|
ret
|
||||||
|
@ -30,8 +30,8 @@
|
|||||||
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
#ifndef NAME
|
#if !defined(ALIAS) || !defined(NAME)
|
||||||
#define NAME byte_swap_2
|
#error ALIAS or NAME not defined
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -39,6 +39,7 @@
|
|||||||
*
|
*
|
||||||
* Argument is an unsigned 2-byte integer (u_int16_t).
|
* Argument is an unsigned 2-byte integer (u_int16_t).
|
||||||
*/
|
*/
|
||||||
|
WEAK_ALIAS(ALIAS, NAME)
|
||||||
ENTRY(NAME, 1)
|
ENTRY(NAME, 1)
|
||||||
mux1 r16=in0,@rev
|
mux1 r16=in0,@rev
|
||||||
;;
|
;;
|
||||||
|
@ -30,8 +30,8 @@
|
|||||||
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
#ifndef NAME
|
#if !defined(ALIAS) || !defined(NAME)
|
||||||
#define NAME byte_swap_4
|
#error ALIAS or NAME not defined
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -39,6 +39,7 @@
|
|||||||
*
|
*
|
||||||
* Argument is an unsigned 4-byte integer (u_int32_t).
|
* Argument is an unsigned 4-byte integer (u_int32_t).
|
||||||
*/
|
*/
|
||||||
|
WEAK_ALIAS(ALIAS, NAME)
|
||||||
ENTRY(NAME, 1)
|
ENTRY(NAME, 1)
|
||||||
mux1 r16=in0,@rev
|
mux1 r16=in0,@rev
|
||||||
;;
|
;;
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NAME htonl
|
#define ALIAS htonl
|
||||||
|
#define NAME __htonl
|
||||||
|
|
||||||
#include "byte_swap_4.S"
|
#include "byte_swap_4.S"
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NAME htons
|
#define ALIAS htons
|
||||||
|
#define NAME __htons
|
||||||
|
|
||||||
#include "byte_swap_2.S"
|
#include "byte_swap_2.S"
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NAME ntohl
|
#define ALIAS ntohl
|
||||||
|
#define NAME __ntohl
|
||||||
|
|
||||||
#include "byte_swap_4.S"
|
#include "byte_swap_4.S"
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NAME ntohs
|
#define ALIAS ntohs
|
||||||
|
#define NAME __ntohs
|
||||||
|
|
||||||
#include "byte_swap_2.S"
|
#include "byte_swap_2.S"
|
||||||
|
@ -41,6 +41,7 @@ static char sccsid[] = "@(#)rune.c 8.1 (Berkeley) 6/4/93";
|
|||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <rune.h>
|
#include <rune.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -31,12 +31,18 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if 0
|
||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "@(#)getservent.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)getservent.c 8.1 (Berkeley) 6/4/93";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
#endif 0
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -41,6 +41,7 @@ static char sccsid[] = "@(#)ns_addr.c 8.1 (Berkeley) 6/7/93";
|
|||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <netns/ns.h>
|
#include <netns/ns.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -31,11 +31,17 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if 0
|
||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "@(#)ns_ntoa.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)ns_ntoa.c 8.1 (Berkeley) 6/4/93";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <netns/ns.h>
|
#include <netns/ns.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
@ -48,7 +48,6 @@
|
|||||||
#include <rpc/auth_des.h>
|
#include <rpc/auth_des.h>
|
||||||
#include <rpc/clnt.h>
|
#include <rpc/clnt.h>
|
||||||
#include <rpc/xdr.h>
|
#include <rpc/xdr.h>
|
||||||
#include <netinet/in.h> /* XXX: just to get htonl() and ntohl() */
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#undef NIS
|
#undef NIS
|
||||||
#include <rpcsvc/nis.h>
|
#include <rpcsvc/nis.h>
|
||||||
|
@ -52,6 +52,7 @@ static char sccsid[] = "@(#)clnt_dg.c 1.19 89/03/16 Copyr 1988 Sun Micro";
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <rpc/rpc.h>
|
#include <rpc/rpc.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -65,6 +65,7 @@ static char sccsid[] = "@(#)clnt_vc.c 1.19 89/03/16 Copyr 1988 Sun Micro";
|
|||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -49,6 +49,7 @@ static char *rcsid = "$FreeBSD$";
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -47,6 +47,7 @@ static char *rcsid = "$FreeBSD$";
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -53,7 +53,9 @@
|
|||||||
#endif /* SYSLIBC_RCS and not lint */
|
#endif /* SYSLIBC_RCS and not lint */
|
||||||
|
|
||||||
/* netorder = htonl(hostorder) */
|
/* netorder = htonl(hostorder) */
|
||||||
ENTRY(htonl)
|
.weak CNAME(htonl)
|
||||||
|
.set CNAME(htonl),CNAME(__htonl)
|
||||||
|
ENTRY(__htonl)
|
||||||
retl
|
retl
|
||||||
srl %o0, 0, %o0 /* zero extend -- or do we sign extend? */
|
srl %o0, 0, %o0 /* zero extend -- or do we sign extend? */
|
||||||
END(htonl)
|
END(__htonl)
|
||||||
|
@ -53,9 +53,11 @@
|
|||||||
#endif /* SYSLIBC_RCS and not lint */
|
#endif /* SYSLIBC_RCS and not lint */
|
||||||
|
|
||||||
/* netorder = htons(hostorder) */
|
/* netorder = htons(hostorder) */
|
||||||
ENTRY(htons)
|
.weak CNAME(htons)
|
||||||
|
.set CNAME(htons),CNAME(__htons)
|
||||||
|
ENTRY(__htons)
|
||||||
sethi %hi(0xffff0000), %o1
|
sethi %hi(0xffff0000), %o1
|
||||||
signx %o1, %o1
|
signx %o1, %o1
|
||||||
retl
|
retl
|
||||||
andn %o0, %o1, %o0
|
andn %o0, %o1, %o0
|
||||||
END(htons)
|
END(__htons)
|
||||||
|
@ -53,7 +53,9 @@
|
|||||||
#endif /* SYSLIBC_RCS and not lint */
|
#endif /* SYSLIBC_RCS and not lint */
|
||||||
|
|
||||||
/* hostorder = ntohl(netorder) */
|
/* hostorder = ntohl(netorder) */
|
||||||
ENTRY(ntohl)
|
.weak CNAME(ntohl)
|
||||||
|
.set CNAME(ntohl),CNAME(__ntohl)
|
||||||
|
ENTRY(__ntohl)
|
||||||
retl
|
retl
|
||||||
signx %o0, %o0
|
signx %o0, %o0
|
||||||
END(ntohl)
|
END(__ntohl)
|
||||||
|
@ -53,9 +53,11 @@
|
|||||||
#endif /* SYSLIBC_RCS and not lint */
|
#endif /* SYSLIBC_RCS and not lint */
|
||||||
|
|
||||||
/* hostorder = ntohs(netorder) */
|
/* hostorder = ntohs(netorder) */
|
||||||
ENTRY(ntohs)
|
.weak CNAME(ntohs)
|
||||||
|
.set CNAME(ntohs),CNAME(__ntohs)
|
||||||
|
ENTRY(__ntohs)
|
||||||
sethi %hi(0xffff0000), %o1
|
sethi %hi(0xffff0000), %o1
|
||||||
signx %o1, %o1
|
signx %o1, %o1
|
||||||
retl
|
retl
|
||||||
andn %o0, %o1, %o0
|
andn %o0, %o1, %o0
|
||||||
END(ntohs)
|
END(__ntohs)
|
||||||
|
@ -49,6 +49,7 @@ static char *rcsid = "$FreeBSD$";
|
|||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <rpc/types.h>
|
#include <rpc/types.h>
|
||||||
#include <rpc/xdr.h>
|
#include <rpc/xdr.h>
|
||||||
#include "un-namespace.h"
|
#include "un-namespace.h"
|
||||||
|
@ -38,6 +38,7 @@ static char *rcsid = "$FreeBSD$";
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/file.h>
|
#include <sys/file.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -42,6 +42,7 @@ static char sccsid[] = "@(#)ipx_addr.c";
|
|||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <netipx/ipx.h>
|
#include <netipx/ipx.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -39,6 +39,7 @@ static char sccsid[] = "@(#)ipx_ntoa.c";
|
|||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <netipx/ipx.h>
|
#include <netipx/ipx.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <net/if_var.h>
|
#include <net/if_var.h>
|
||||||
#include <net/if_dl.h>
|
#include <net/if_dl.h>
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <netncp/ncp_lib.h>
|
#include <netncp/ncp_lib.h>
|
||||||
|
@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
|
@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
|
@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <netipx/ipx.h>
|
#include <netipx/ipx.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -231,7 +231,7 @@ intoa(addr)
|
|||||||
register int n;
|
register int n;
|
||||||
static char buf[17]; /* strlen(".255.255.255.255") + 1 */
|
static char buf[17]; /* strlen(".255.255.255.255") + 1 */
|
||||||
|
|
||||||
NTOHL(addr);
|
addr = ntohl(addr);
|
||||||
cp = &buf[sizeof buf];
|
cp = &buf[sizeof buf];
|
||||||
*--cp = '\0';
|
*--cp = '\0';
|
||||||
|
|
||||||
|
@ -371,6 +371,19 @@ extern void panic(const char *, ...) __dead2;
|
|||||||
extern struct fs_ops *file_system[];
|
extern struct fs_ops *file_system[];
|
||||||
extern struct devsw *devsw[];
|
extern struct devsw *devsw[];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Expose byteorder(3) functions.
|
||||||
|
*/
|
||||||
|
#define htonl(x) __htonl(x)
|
||||||
|
#define htons(x) __htons(x)
|
||||||
|
#define ntohl(x) __ntohl(x)
|
||||||
|
#define ntohs(x) __ntohs(x)
|
||||||
|
|
||||||
|
extern uint32_t htonl(uint32_t);
|
||||||
|
extern uint16_t htons(uint16_t);
|
||||||
|
extern uint32_t ntohl(uint32_t);
|
||||||
|
extern uint16_t ntohs(uint16_t);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
static inline void *
|
static inline void *
|
||||||
|
@ -39,6 +39,7 @@ static const char rcsid[] =
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <rpc/rpc.h>
|
#include <rpc/rpc.h>
|
||||||
#include <rpc/pmap_clnt.h>
|
#include <rpc/pmap_clnt.h>
|
||||||
#include <rpcsvc/rwall.h>
|
#include <rpcsvc/rwall.h>
|
||||||
|
@ -43,6 +43,7 @@ static const char rcsid[] =
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <protocols/talkd.h>
|
#include <protocols/talkd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
@ -58,6 +58,8 @@ static const char rcsid[] =
|
|||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
#include <sys/../isofs/cd9660/cd9660_mount.h>
|
#include <sys/../isofs/cd9660/cd9660_mount.h>
|
||||||
|
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -284,7 +284,7 @@ iflookup(naddr addr)
|
|||||||
naddr /* host byte order */
|
naddr /* host byte order */
|
||||||
std_mask(naddr addr) /* network byte order */
|
std_mask(naddr addr) /* network byte order */
|
||||||
{
|
{
|
||||||
NTOHL(addr); /* was a host, not a network */
|
addr = ntohl(addr); /* was a host, not a network */
|
||||||
|
|
||||||
if (addr == 0) /* default route has mask 0 */
|
if (addr == 0) /* default route has mask 0 */
|
||||||
return 0;
|
return 0;
|
||||||
@ -372,7 +372,7 @@ ripv1_mask_host(naddr addr, /* in network byte order */
|
|||||||
int /* 0=bad */
|
int /* 0=bad */
|
||||||
check_dst(naddr addr)
|
check_dst(naddr addr)
|
||||||
{
|
{
|
||||||
NTOHL(addr);
|
addr = ntohl(addr);
|
||||||
|
|
||||||
if (IN_CLASSA(addr)) {
|
if (IN_CLASSA(addr)) {
|
||||||
if (addr == 0)
|
if (addr == 0)
|
||||||
|
@ -277,7 +277,7 @@ input(struct sockaddr_in *from, /* received from this IP address */
|
|||||||
clr_ws_buf(&v12buf, ap);
|
clr_ws_buf(&v12buf, ap);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
NTOHL(n->n_metric);
|
n->n_metric = ntohl(n->n_metric);
|
||||||
|
|
||||||
/* A single entry with family RIP_AF_UNSPEC and
|
/* A single entry with family RIP_AF_UNSPEC and
|
||||||
* metric HOPCNT_INFINITY means "all routes".
|
* metric HOPCNT_INFINITY means "all routes".
|
||||||
@ -413,7 +413,7 @@ input(struct sockaddr_in *from, /* received from this IP address */
|
|||||||
v12buf.n->n_nhop = rt->rt_gate;
|
v12buf.n->n_nhop = rt->rt_gate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HTONL(v12buf.n->n_metric);
|
v12buf.n->n_metric = htonl(v12buf.n->n_metric);
|
||||||
|
|
||||||
/* Stop paying attention if we fill the output buffer.
|
/* Stop paying attention if we fill the output buffer.
|
||||||
*/
|
*/
|
||||||
@ -582,7 +582,7 @@ input(struct sockaddr_in *from, /* received from this IP address */
|
|||||||
if (n->n_family == RIP_AF_AUTH)
|
if (n->n_family == RIP_AF_AUTH)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
NTOHL(n->n_metric);
|
n->n_metric = ntohl(n->n_metric);
|
||||||
dst = n->n_dst;
|
dst = n->n_dst;
|
||||||
if (n->n_family != RIP_AF_INET
|
if (n->n_family != RIP_AF_INET
|
||||||
&& (n->n_family != RIP_AF_UNSPEC
|
&& (n->n_family != RIP_AF_UNSPEC
|
||||||
|
@ -419,7 +419,7 @@ supply_out(struct ag_info *ag)
|
|||||||
wb->n->n_metric = ((stopint || ag->ag_metric < 1)
|
wb->n->n_metric = ((stopint || ag->ag_metric < 1)
|
||||||
? HOPCNT_INFINITY
|
? HOPCNT_INFINITY
|
||||||
: ag->ag_metric);
|
: ag->ag_metric);
|
||||||
HTONL(wb->n->n_metric);
|
wb->n->n_metric = htonl(wb->n->n_metric);
|
||||||
/* Any non-zero bits in the supposedly unused RIPv1 fields
|
/* Any non-zero bits in the supposedly unused RIPv1 fields
|
||||||
* cause the old `routed` to ignore the route.
|
* cause the old `routed` to ignore the route.
|
||||||
* That means the mask and so forth cannot be sent
|
* That means the mask and so forth cannot be sent
|
||||||
|
@ -249,7 +249,8 @@ gwkludge(void)
|
|||||||
dname, lptr);
|
dname, lptr);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
HTONL(dst); /* make network # into IP address */
|
/* Turn network # into IP address. */
|
||||||
|
dst = htonl(dst);
|
||||||
} else {
|
} else {
|
||||||
msglog("bad \"%s\" in "_PATH_GATEWAYS
|
msglog("bad \"%s\" in "_PATH_GATEWAYS
|
||||||
" entry \"%s\"", net_host, lptr);
|
" entry \"%s\"", net_host, lptr);
|
||||||
@ -612,7 +613,7 @@ parse_parms(char *line,
|
|||||||
free(intnetp);
|
free(intnetp);
|
||||||
return bad_str(line);
|
return bad_str(line);
|
||||||
}
|
}
|
||||||
HTONL(intnetp->intnet_addr);
|
intnetp->intnet_addr = htonl(intnetp->intnet_addr);
|
||||||
intnetp->intnet_next = intnets;
|
intnetp->intnet_next = intnets;
|
||||||
intnets = intnetp;
|
intnets = intnetp;
|
||||||
return 0;
|
return 0;
|
||||||
@ -945,7 +946,7 @@ getnet(char *name,
|
|||||||
if (0 == (in.s_addr & 0xff000000))
|
if (0 == (in.s_addr & 0xff000000))
|
||||||
in.s_addr <<= 8;
|
in.s_addr <<= 8;
|
||||||
} else if (inet_aton(name, &in) == 1) {
|
} else if (inet_aton(name, &in) == 1) {
|
||||||
NTOHL(in.s_addr);
|
in.s_addr = ntohl(in.s_addr);
|
||||||
} else if (!mname && !strcasecmp(name,"default")) {
|
} else if (!mname && !strcasecmp(name,"default")) {
|
||||||
in.s_addr = RIP_DEFAULT;
|
in.s_addr = RIP_DEFAULT;
|
||||||
} else {
|
} else {
|
||||||
|
@ -782,7 +782,7 @@ rip_input(struct sockaddr_in *from,
|
|||||||
static u_int
|
static u_int
|
||||||
std_mask(u_int addr) /* in network order */
|
std_mask(u_int addr) /* in network order */
|
||||||
{
|
{
|
||||||
NTOHL(addr); /* was a host, not a network */
|
addr = ntohl(addr); /* was a host, not a network */
|
||||||
|
|
||||||
if (addr == 0) /* default route has mask 0 */
|
if (addr == 0) /* default route has mask 0 */
|
||||||
return 0;
|
return 0;
|
||||||
@ -825,7 +825,7 @@ getnet(char *name,
|
|||||||
if (nentp != 0) {
|
if (nentp != 0) {
|
||||||
in.s_addr = nentp->n_net;
|
in.s_addr = nentp->n_net;
|
||||||
} else if (inet_aton(name, &in) == 1) {
|
} else if (inet_aton(name, &in) == 1) {
|
||||||
NTOHL(in.s_addr);
|
in.s_addr = ntohl(in.s_addr);
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ ag_check(naddr dst,
|
|||||||
naddr xaddr;
|
naddr xaddr;
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
NTOHL(dst);
|
dst = ntohl(dst);
|
||||||
|
|
||||||
/* Punt non-contiguous subnet masks.
|
/* Punt non-contiguous subnet masks.
|
||||||
*
|
*
|
||||||
|
@ -53,6 +53,7 @@
|
|||||||
*/
|
*/
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "crypt.h"
|
#include "crypt.h"
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
/* $FreeBSD$ */
|
/*-
|
||||||
/* From: NetBSD: endian.h,v 1.5 1997/10/09 15:42:19 bouyer Exp */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 1987, 1991, 1993
|
* Copyright (c) 1987, 1991, 1993
|
||||||
* The Regents of the University of California. All rights reserved.
|
* The Regents of the University of California. All rights reserved.
|
||||||
*
|
*
|
||||||
@ -34,10 +31,14 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)endian.h 8.1 (Berkeley) 6/10/93
|
* @(#)endian.h 8.1 (Berkeley) 6/10/93
|
||||||
|
* $NetBSD: endian.h,v 1.5 1997/10/09 15:42:19 bouyer Exp $
|
||||||
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _ENDIAN_H_
|
#ifndef _MACHINE_ENDIAN_H_
|
||||||
#define _ENDIAN_H_
|
#define _MACHINE_ENDIAN_H_
|
||||||
|
|
||||||
|
#include <machine/ansi.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define the order of 32-bit words in 64-bit words.
|
* Define the order of 32-bit words in 64-bit words.
|
||||||
@ -45,52 +46,16 @@
|
|||||||
#define _QUAD_HIGHWORD 1
|
#define _QUAD_HIGHWORD 1
|
||||||
#define _QUAD_LOWWORD 0
|
#define _QUAD_LOWWORD 0
|
||||||
|
|
||||||
#ifndef _POSIX_SOURCE
|
|
||||||
/*
|
/*
|
||||||
* Definitions for byte order, according to byte significance from low
|
* Definitions for byte order, according to byte significance from low
|
||||||
* address to high.
|
* address to high.
|
||||||
*/
|
*/
|
||||||
|
#ifndef _POSIX_SOURCE
|
||||||
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
|
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
|
||||||
#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
|
#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
|
||||||
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
|
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
|
||||||
|
|
||||||
#define BYTE_ORDER LITTLE_ENDIAN
|
#define BYTE_ORDER LITTLE_ENDIAN
|
||||||
|
|
||||||
#ifndef _KERNEL
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#endif
|
|
||||||
#include <machine/ansi.h>
|
|
||||||
|
|
||||||
__BEGIN_DECLS
|
|
||||||
__uint32_t htonl __P((__uint32_t));
|
|
||||||
__uint16_t htons __P((__uint16_t));
|
|
||||||
__uint32_t ntohl __P((__uint32_t));
|
|
||||||
__uint16_t ntohs __P((__uint16_t));
|
|
||||||
__uint16_t bswap16 __P((__uint16_t));
|
|
||||||
__uint32_t bswap32 __P((__uint32_t));
|
|
||||||
__uint64_t bswap64 __P((__uint64_t));
|
|
||||||
__END_DECLS
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Macros for network/external number representation conversion.
|
|
||||||
*/
|
|
||||||
#if BYTE_ORDER == BIG_ENDIAN && !defined(lint)
|
|
||||||
#define ntohl(x) (x)
|
|
||||||
#define ntohs(x) (x)
|
|
||||||
#define htonl(x) (x)
|
|
||||||
#define htons(x) (x)
|
|
||||||
|
|
||||||
#define NTOHL(x) (x)
|
|
||||||
#define NTOHS(x) (x)
|
|
||||||
#define HTONL(x) (x)
|
|
||||||
#define HTONS(x) (x)
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define NTOHL(x) (x) = ntohl((__uint32_t)x)
|
|
||||||
#define NTOHS(x) (x) = ntohs((__uint16_t)x)
|
|
||||||
#define HTONL(x) (x) = htonl((__uint32_t)x)
|
|
||||||
#define HTONS(x) (x) = htons((__uint16_t)x)
|
|
||||||
#endif
|
|
||||||
#endif /* !_POSIX_SOURCE */
|
#endif /* !_POSIX_SOURCE */
|
||||||
#endif /* !_ENDIAN_H_ */
|
|
||||||
|
#endif /* !_MACHINE_ENDIAN_H_ */
|
||||||
|
@ -1991,7 +1991,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
|
|||||||
bcd2bin(th->starting_track);
|
bcd2bin(th->starting_track);
|
||||||
th->ending_track = bcd2bin(th->ending_track);
|
th->ending_track = bcd2bin(th->ending_track);
|
||||||
}
|
}
|
||||||
NTOHS(th->len);
|
th->len = ntohs(th->len);
|
||||||
bcopy(th, addr, sizeof(*th));
|
bcopy(th, addr, sizeof(*th));
|
||||||
free(th, M_TEMP);
|
free(th, M_TEMP);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*-
|
||||||
* Copyright (c) 1987, 1991 Regents of the University of California.
|
* Copyright (c) 1987, 1991 Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@ -30,55 +30,37 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* from: @(#)endian.h 7.8 (Berkeley) 4/3/91
|
* @(#)endian.h 7.8 (Berkeley) 4/3/91
|
||||||
* $FreeBSD$
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _MACHINE_ENDIAN_H_
|
#ifndef _MACHINE_ENDIAN_H_
|
||||||
#define _MACHINE_ENDIAN_H_
|
#define _MACHINE_ENDIAN_H_
|
||||||
|
|
||||||
|
#include <machine/ansi.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define the order of 32-bit words in 64-bit words.
|
* Define the order of 32-bit words in 64-bit words.
|
||||||
*/
|
*/
|
||||||
#define _QUAD_HIGHWORD 1
|
#define _QUAD_HIGHWORD 1
|
||||||
#define _QUAD_LOWWORD 0
|
#define _QUAD_LOWWORD 0
|
||||||
|
|
||||||
#ifndef _POSIX_SOURCE
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Definitions for byte order, according to byte significance from low
|
* Definitions for byte order, according to byte significance from low
|
||||||
* address to high.
|
* address to high.
|
||||||
*/
|
*/
|
||||||
|
#ifndef _POSIX_SOURCE
|
||||||
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
|
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
|
||||||
#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
|
#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
|
||||||
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
|
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
|
||||||
|
|
||||||
#define BYTE_ORDER LITTLE_ENDIAN
|
#define BYTE_ORDER LITTLE_ENDIAN
|
||||||
|
#endif /* ! _POSIX_SOURCE */
|
||||||
#ifndef _KERNEL
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#endif
|
|
||||||
#include <machine/ansi.h>
|
|
||||||
|
|
||||||
__BEGIN_DECLS
|
|
||||||
__uint32_t htonl(__uint32_t);
|
|
||||||
__uint16_t htons(__uint16_t);
|
|
||||||
__uint32_t ntohl(__uint32_t);
|
|
||||||
__uint16_t ntohs(__uint16_t);
|
|
||||||
__END_DECLS
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
|
||||||
static __inline __uint32_t
|
static __inline __uint32_t
|
||||||
__uint16_swap_uint32(__uint32_t __x)
|
__htonl(__uint32_t __x)
|
||||||
{
|
|
||||||
__asm ("rorl $16, %0" : "+r" (__x));
|
|
||||||
|
|
||||||
return __x;
|
|
||||||
}
|
|
||||||
|
|
||||||
static __inline __uint32_t
|
|
||||||
__uint8_swap_uint32(__uint32_t __x)
|
|
||||||
{
|
{
|
||||||
#if defined(_KERNEL) && (defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)) && !defined(I386_CPU)
|
#if defined(_KERNEL) && (defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)) && !defined(I386_CPU)
|
||||||
__asm ("bswap %0" : "+r" (__x));
|
__asm ("bswap %0" : "+r" (__x));
|
||||||
@ -92,29 +74,27 @@ __uint8_swap_uint32(__uint32_t __x)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static __inline __uint16_t
|
static __inline __uint16_t
|
||||||
__uint8_swap_uint16(__uint16_t __x)
|
__htons(__uint16_t __x)
|
||||||
{
|
{
|
||||||
__asm ("xchgb %h0, %b0" : "+q" (__x));
|
__asm ("xchgb %h0, %b0" : "+q" (__x));
|
||||||
|
|
||||||
return __x;
|
return __x;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
static __inline __uint32_t
|
||||||
* Macros for network/external number representation conversion.
|
__ntohl(__uint32_t __x)
|
||||||
*/
|
{
|
||||||
#define ntohl __uint8_swap_uint32
|
|
||||||
#define ntohs __uint8_swap_uint16
|
return (__htonl(__x));
|
||||||
#define htonl __uint8_swap_uint32
|
}
|
||||||
#define htons __uint8_swap_uint16
|
|
||||||
|
static __inline __uint16_t
|
||||||
|
__ntohs(__uint16_t __x)
|
||||||
|
{
|
||||||
|
|
||||||
|
return (__htons(__x));
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __GNUC__ */
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
#define NTOHL(x) ((x) = ntohl(x))
|
|
||||||
#define NTOHS(x) ((x) = ntohs(x))
|
|
||||||
#define HTONL(x) ((x) = htonl(x))
|
|
||||||
#define HTONS(x) ((x) = htons(x))
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* ! _POSIX_SOURCE */
|
|
||||||
|
|
||||||
#endif /* !_MACHINE_ENDIAN_H_ */
|
#endif /* !_MACHINE_ENDIAN_H_ */
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
/* $FreeBSD$ */
|
/*-
|
||||||
/* From: NetBSD: endian.h,v 1.5 1997/10/09 15:42:19 bouyer Exp */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 1987, 1991, 1993
|
* Copyright (c) 1987, 1991, 1993
|
||||||
* The Regents of the University of California. All rights reserved.
|
* The Regents of the University of California. All rights reserved.
|
||||||
*
|
*
|
||||||
@ -34,10 +31,14 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)endian.h 8.1 (Berkeley) 6/10/93
|
* @(#)endian.h 8.1 (Berkeley) 6/10/93
|
||||||
|
* $NetBSD: endian.h,v 1.5 1997/10/09 15:42:19 bouyer Exp $
|
||||||
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _ENDIAN_H_
|
#ifndef _MACHINE_ENDIAN_H_
|
||||||
#define _ENDIAN_H_
|
#define _MACHINE_ENDIAN_H_
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define the order of 32-bit words in 64-bit words.
|
* Define the order of 32-bit words in 64-bit words.
|
||||||
@ -45,44 +46,17 @@
|
|||||||
#define _QUAD_HIGHWORD 1
|
#define _QUAD_HIGHWORD 1
|
||||||
#define _QUAD_LOWWORD 0
|
#define _QUAD_LOWWORD 0
|
||||||
|
|
||||||
#ifndef _POSIX_SOURCE
|
|
||||||
/*
|
/*
|
||||||
* Definitions for byte order, according to byte significance from low
|
* Definitions for byte order, according to byte significance from low
|
||||||
* address to high.
|
* address to high.
|
||||||
*/
|
*/
|
||||||
|
#ifndef _POSIX_SOURCE
|
||||||
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
|
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
|
||||||
#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
|
#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
|
||||||
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
|
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
|
||||||
|
|
||||||
#define BYTE_ORDER LITTLE_ENDIAN
|
#define BYTE_ORDER LITTLE_ENDIAN
|
||||||
|
#endif /* !_POSIX_SOURCE */
|
||||||
#ifndef _KERNEL
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#endif
|
|
||||||
#include <machine/ansi.h>
|
|
||||||
|
|
||||||
__BEGIN_DECLS
|
|
||||||
__uint32_t htonl __P((__uint32_t));
|
|
||||||
__uint16_t htons __P((__uint16_t));
|
|
||||||
__uint32_t ntohl __P((__uint32_t));
|
|
||||||
__uint16_t ntohs __P((__uint16_t));
|
|
||||||
__END_DECLS
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Macros for network/external number representation conversion.
|
|
||||||
*/
|
|
||||||
#if BYTE_ORDER == BIG_ENDIAN && !defined(lint)
|
|
||||||
#define ntohl(x) (x)
|
|
||||||
#define ntohs(x) (x)
|
|
||||||
#define htonl(x) (x)
|
|
||||||
#define htons(x) (x)
|
|
||||||
|
|
||||||
#define NTOHL(x) (x)
|
|
||||||
#define NTOHS(x) (x)
|
|
||||||
#define HTONL(x) (x)
|
|
||||||
#define HTONS(x) (x)
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
|
||||||
@ -96,31 +70,33 @@ __uint8_swap_uint64(__uint64_t __x)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static __inline __uint32_t
|
static __inline __uint32_t
|
||||||
__uint8_swap_uint32(__uint32_t __x)
|
__htonl(__uint32_t __x)
|
||||||
{
|
{
|
||||||
return __uint8_swap_uint64(__x) >> 32;
|
|
||||||
|
return (__uint8_swap_uint64(__x) >> 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline __uint16_t
|
static __inline __uint16_t
|
||||||
__uint8_swap_uint16(__uint16_t __x)
|
__htons(__uint16_t __x)
|
||||||
{
|
{
|
||||||
return __uint8_swap_uint64(__x) >> 48;
|
|
||||||
|
return (__uint8_swap_uint64(__x) >> 48);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
static __inline __uint32_t
|
||||||
* Macros for network/external number representation conversion.
|
__ntohl(__uint32_t __x)
|
||||||
*/
|
{
|
||||||
#define ntohl __uint8_swap_uint32
|
|
||||||
#define ntohs __uint8_swap_uint16
|
return (__uint8_swap_uint64(__x) >> 32);
|
||||||
#define htonl __uint8_swap_uint32
|
}
|
||||||
#define htons __uint8_swap_uint16
|
|
||||||
|
static __inline __uint16_t
|
||||||
|
__ntohs(__uint16_t __x)
|
||||||
|
{
|
||||||
|
|
||||||
|
return (__uint8_swap_uint64(__x) >> 48);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __GNUC__ */
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
#define NTOHL(x) (x) = ntohl((__uint32_t)x)
|
#endif /* !_MACHINE_ENDIAN_H_ */
|
||||||
#define NTOHS(x) (x) = ntohs((__uint16_t)x)
|
|
||||||
#define HTONL(x) (x) = htonl((__uint32_t)x)
|
|
||||||
#define HTONS(x) (x) = htons((__uint16_t)x)
|
|
||||||
#endif
|
|
||||||
#endif /* !_POSIX_SOURCE */
|
|
||||||
#endif /* !_ENDIAN_H_ */
|
|
||||||
|
@ -30,8 +30,8 @@
|
|||||||
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
#ifndef NAME
|
#if !defined(ALIAS) || !defined(NAME)
|
||||||
#define NAME byte_swap_2
|
#error ALIAS or NAME not defined
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -39,6 +39,7 @@
|
|||||||
*
|
*
|
||||||
* Argument is an unsigned 2-byte integer (u_int16_t).
|
* Argument is an unsigned 2-byte integer (u_int16_t).
|
||||||
*/
|
*/
|
||||||
|
XLEAF(ALIAS, 1)
|
||||||
LEAF(NAME, 1) /* a0 contains 0x0123 */
|
LEAF(NAME, 1) /* a0 contains 0x0123 */
|
||||||
extbl a0, 0, t0 /* t0 = 0x 23 */
|
extbl a0, 0, t0 /* t0 = 0x 23 */
|
||||||
extbl a0, 1, t1 /* t1 = 0x 01 */
|
extbl a0, 1, t1 /* t1 = 0x 01 */
|
||||||
|
@ -30,8 +30,8 @@
|
|||||||
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
#ifndef NAME
|
#if !defined(ALIAS) || !defined(NAME)
|
||||||
#define NAME byte_swap_4
|
#error ALIAS or NAME not defined
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -39,6 +39,7 @@
|
|||||||
*
|
*
|
||||||
* Argument is an unsigned 4-byte integer (u_int32_t).
|
* Argument is an unsigned 4-byte integer (u_int32_t).
|
||||||
*/
|
*/
|
||||||
|
XLEAF(ALIAS, 1)
|
||||||
LEAF(NAME, 1) /* a0 contains 0x01234567 */
|
LEAF(NAME, 1) /* a0 contains 0x01234567 */
|
||||||
extbl a0, 0, t0 /* t0 = 0x 67 */
|
extbl a0, 0, t0 /* t0 = 0x 67 */
|
||||||
extbl a0, 1, t1 /* t1 = 0x 45 */
|
extbl a0, 1, t1 /* t1 = 0x 45 */
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NAME htonl
|
#define ALIAS htonl
|
||||||
|
#define NAME __htonl
|
||||||
|
|
||||||
#include <libkern/alpha/byte_swap_4.S>
|
#include <libkern/alpha/byte_swap_4.S>
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NAME htons
|
#define ALIAS htons
|
||||||
|
#define NAME __htons
|
||||||
|
|
||||||
#include <libkern/alpha/byte_swap_2.S>
|
#include <libkern/alpha/byte_swap_2.S>
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NAME ntohl
|
#define ALIAS ntohl
|
||||||
|
#define NAME __ntohl
|
||||||
|
|
||||||
#include <libkern/alpha/byte_swap_4.S>
|
#include <libkern/alpha/byte_swap_4.S>
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NAME ntohs
|
#define ALIAS ntohs
|
||||||
|
#define NAME __ntohs
|
||||||
|
|
||||||
#include <libkern/alpha/byte_swap_2.S>
|
#include <libkern/alpha/byte_swap_2.S>
|
||||||
|
@ -30,8 +30,8 @@
|
|||||||
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
#ifndef NAME
|
#if !defined(ALIAS) || !defined(NAME)
|
||||||
#define NAME byte_swap_2
|
#error ALIAS or NAME not defined
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -39,6 +39,7 @@
|
|||||||
*
|
*
|
||||||
* Argument is an unsigned 2-byte integer (u_int16_t).
|
* Argument is an unsigned 2-byte integer (u_int16_t).
|
||||||
*/
|
*/
|
||||||
|
WEAK_ALIAS(ALIAS, NAME)
|
||||||
ENTRY(NAME, 1)
|
ENTRY(NAME, 1)
|
||||||
mux1 r16=in0,@rev
|
mux1 r16=in0,@rev
|
||||||
;;
|
;;
|
||||||
|
@ -30,8 +30,8 @@
|
|||||||
|
|
||||||
#include <machine/asm.h>
|
#include <machine/asm.h>
|
||||||
|
|
||||||
#ifndef NAME
|
#if !defined(ALIAS) || !defined(NAME)
|
||||||
#define NAME byte_swap_4
|
#error ALIAS or NAME not defined
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -39,6 +39,7 @@
|
|||||||
*
|
*
|
||||||
* Argument is an unsigned 4-byte integer (u_int32_t).
|
* Argument is an unsigned 4-byte integer (u_int32_t).
|
||||||
*/
|
*/
|
||||||
|
WEAK_ALIAS(ALIAS, NAME)
|
||||||
ENTRY(NAME, 1)
|
ENTRY(NAME, 1)
|
||||||
mux1 r16=in0,@rev
|
mux1 r16=in0,@rev
|
||||||
;;
|
;;
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NAME htonl
|
#define ALIAS htonl
|
||||||
|
#define NAME __htonl
|
||||||
|
|
||||||
#include <libkern/ia64/byte_swap_4.S>
|
#include <libkern/ia64/byte_swap_4.S>
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NAME htons
|
#define ALIAS htons
|
||||||
|
#define NAME __htons
|
||||||
|
|
||||||
#include <libkern/ia64/byte_swap_2.S>
|
#include <libkern/ia64/byte_swap_2.S>
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NAME ntohl
|
#define ALIAS ntohl
|
||||||
|
#define NAME __ntohl
|
||||||
|
|
||||||
#include <libkern/ia64/byte_swap_4.S>
|
#include <libkern/ia64/byte_swap_4.S>
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define NAME ntohs
|
#define ALIAS ntohs
|
||||||
|
#define NAME __ntohs
|
||||||
|
|
||||||
#include <libkern/ia64/byte_swap_2.S>
|
#include <libkern/ia64/byte_swap_2.S>
|
||||||
|
@ -867,8 +867,8 @@ bdg_forward(struct mbuf *m0, struct ether_header *const eh, struct ifnet *dst)
|
|||||||
* here we assume the pkt is an IP one and the header is contiguous
|
* here we assume the pkt is an IP one and the header is contiguous
|
||||||
*/
|
*/
|
||||||
ip = mtod(m0, struct ip *);
|
ip = mtod(m0, struct ip *);
|
||||||
NTOHS(ip->ip_len);
|
ip->ip_len = ntohs(ip->ip_len);
|
||||||
NTOHS(ip->ip_off);
|
ip->ip_off = ntohs(ip->ip_off);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The third parameter to the firewall code is the dst. interface.
|
* The third parameter to the firewall code is the dst. interface.
|
||||||
@ -881,11 +881,11 @@ bdg_forward(struct mbuf *m0, struct ether_header *const eh, struct ifnet *dst)
|
|||||||
return m0 ;
|
return m0 ;
|
||||||
/*
|
/*
|
||||||
* If we get here, the firewall has passed the pkt, but the mbuf
|
* If we get here, the firewall has passed the pkt, but the mbuf
|
||||||
* pointer might have changed. Restore ip and the fields NTOHS()'d.
|
* pointer might have changed. Restore ip and the fields ntohs()'d.
|
||||||
*/
|
*/
|
||||||
ip = mtod(m0, struct ip *);
|
ip = mtod(m0, struct ip *);
|
||||||
HTONS(ip->ip_len);
|
ip->ip_len = htons(ip->ip_len);
|
||||||
HTONS(ip->ip_off);
|
ip->ip_off = htons(ip->ip_off);
|
||||||
|
|
||||||
if (i == 0) /* a PASS rule. */
|
if (i == 0) /* a PASS rule. */
|
||||||
goto forward ;
|
goto forward ;
|
||||||
|
@ -574,7 +574,7 @@ ng_mppc_decompress(node_p node, struct mbuf *m, struct mbuf **resultp)
|
|||||||
if (m->m_pkthdr.len < MPPC_HDRLEN)
|
if (m->m_pkthdr.len < MPPC_HDRLEN)
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
m_copydata(m, 0, MPPC_HDRLEN, (caddr_t)&header);
|
m_copydata(m, 0, MPPC_HDRLEN, (caddr_t)&header);
|
||||||
NTOHS(header);
|
header = ntohs(header);
|
||||||
cc = (header & MPPC_CCOUNT_MASK);
|
cc = (header & MPPC_CCOUNT_MASK);
|
||||||
|
|
||||||
/* Copy payload into a contiguous region of memory */
|
/* Copy payload into a contiguous region of memory */
|
||||||
|
@ -496,6 +496,23 @@ char *inet_ntoa_r __P((struct in_addr ina, char *buf)); /* in libkern */
|
|||||||
#define sintosa(sin) ((struct sockaddr *)(sin))
|
#define sintosa(sin) ((struct sockaddr *)(sin))
|
||||||
#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
|
#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
|
||||||
|
|
||||||
|
#else /* !_KERNEL */
|
||||||
|
|
||||||
|
#ifndef _BYTEORDER_FUNC_DEFINED
|
||||||
|
#define _BYTEORDER_FUNC_DEFINED
|
||||||
|
#define htonl(x) __htonl(x)
|
||||||
|
#define htons(x) __htons(x)
|
||||||
|
#define ntohl(x) __ntohl(x)
|
||||||
|
#define ntohs(x) __ntohs(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
__BEGIN_DECLS
|
||||||
|
__uint32_t htonl __P((__uint32_t));
|
||||||
|
__uint16_t htons __P((__uint16_t));
|
||||||
|
__uint32_t ntohl __P((__uint32_t));
|
||||||
|
__uint16_t ntohs __P((__uint16_t));
|
||||||
|
__END_DECLS
|
||||||
|
|
||||||
|
#endif /* _KERNEL */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -291,8 +291,8 @@ div_output(so, m, addr, control)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Convert fields to host order for ip_output() */
|
/* Convert fields to host order for ip_output() */
|
||||||
NTOHS(ip->ip_len);
|
ip->ip_len = ntohs(ip->ip_len);
|
||||||
NTOHS(ip->ip_off);
|
ip->ip_off = ntohs(ip->ip_off);
|
||||||
|
|
||||||
/* Send packet to output processing */
|
/* Send packet to output processing */
|
||||||
ipstat.ips_rawout++; /* XXX */
|
ipstat.ips_rawout++; /* XXX */
|
||||||
|
@ -1575,8 +1575,8 @@ ip_fw_chk(struct ip **pip, int hlen,
|
|||||||
ti.ti_i = *((struct ipovly *) ip);
|
ti.ti_i = *((struct ipovly *) ip);
|
||||||
ti.ti_t = *tcp;
|
ti.ti_t = *tcp;
|
||||||
bcopy(&ti, ip, sizeof(ti));
|
bcopy(&ti, ip, sizeof(ti));
|
||||||
NTOHL(tip->ti_seq);
|
tip->ti_seq = ntohl(tip->ti_seq);
|
||||||
NTOHL(tip->ti_ack);
|
tip->ti_ack = ntohl(tip->ti_ack);
|
||||||
tip->ti_len = ip_len - hlen - (tip->ti_off << 2);
|
tip->ti_len = ip_len - hlen - (tip->ti_off << 2);
|
||||||
if (tcp->th_flags & TH_ACK) {
|
if (tcp->th_flags & TH_ACK) {
|
||||||
tcp_respond(NULL, (void *)ip, tcp, *m,
|
tcp_respond(NULL, (void *)ip, tcp, *m,
|
||||||
|
@ -193,8 +193,8 @@ icmp_error(n, type, code, dest, destifp)
|
|||||||
/*
|
/*
|
||||||
* Convert fields to network representation.
|
* Convert fields to network representation.
|
||||||
*/
|
*/
|
||||||
HTONS(nip->ip_len);
|
nip->ip_len = htons(nip->ip_len);
|
||||||
HTONS(nip->ip_off);
|
nip->ip_off = htons(nip->ip_off);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now, copy old ip header (without options)
|
* Now, copy old ip header (without options)
|
||||||
@ -363,7 +363,7 @@ icmp_input(m, off)
|
|||||||
icmpstat.icps_badlen++;
|
icmpstat.icps_badlen++;
|
||||||
goto freeit;
|
goto freeit;
|
||||||
}
|
}
|
||||||
NTOHS(icp->icmp_ip.ip_len);
|
icp->icmp_ip.ip_len = ntohs(icp->icmp_ip.ip_len);
|
||||||
/* Discard ICMP's in response to multicast packets */
|
/* Discard ICMP's in response to multicast packets */
|
||||||
if (IN_MULTICAST(ntohl(icp->icmp_ip.ip_dst.s_addr)))
|
if (IN_MULTICAST(ntohl(icp->icmp_ip.ip_dst.s_addr)))
|
||||||
goto badcode;
|
goto badcode;
|
||||||
|
@ -369,12 +369,12 @@ ip_input(struct mbuf *m)
|
|||||||
/*
|
/*
|
||||||
* Convert fields to host representation.
|
* Convert fields to host representation.
|
||||||
*/
|
*/
|
||||||
NTOHS(ip->ip_len);
|
ip->ip_len = ntohs(ip->ip_len);
|
||||||
if (ip->ip_len < hlen) {
|
if (ip->ip_len < hlen) {
|
||||||
ipstat.ips_badlen++;
|
ipstat.ips_badlen++;
|
||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
NTOHS(ip->ip_off);
|
ip->ip_off = ntohs(ip->ip_off);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check that the amount of data in the buffers
|
* Check that the amount of data in the buffers
|
||||||
@ -762,15 +762,15 @@ ip_input(struct mbuf *m)
|
|||||||
/* Restore original checksum before diverting packet */
|
/* Restore original checksum before diverting packet */
|
||||||
if (divert_info != 0) {
|
if (divert_info != 0) {
|
||||||
ip->ip_len += hlen;
|
ip->ip_len += hlen;
|
||||||
HTONS(ip->ip_len);
|
ip->ip_len = htons(ip->ip_len);
|
||||||
HTONS(ip->ip_off);
|
ip->ip_off = htons(ip->ip_off);
|
||||||
ip->ip_sum = 0;
|
ip->ip_sum = 0;
|
||||||
if (hlen == sizeof(struct ip))
|
if (hlen == sizeof(struct ip))
|
||||||
ip->ip_sum = in_cksum_hdr(ip);
|
ip->ip_sum = in_cksum_hdr(ip);
|
||||||
else
|
else
|
||||||
ip->ip_sum = in_cksum(m, hlen);
|
ip->ip_sum = in_cksum(m, hlen);
|
||||||
NTOHS(ip->ip_off);
|
ip->ip_off = ntohs(ip->ip_off);
|
||||||
NTOHS(ip->ip_len);
|
ip->ip_len = ntohs(ip->ip_len);
|
||||||
ip->ip_len -= hlen;
|
ip->ip_len -= hlen;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -793,8 +793,8 @@ ip_input(struct mbuf *m)
|
|||||||
|
|
||||||
/* Restore packet header fields to original values */
|
/* Restore packet header fields to original values */
|
||||||
ip->ip_len += hlen;
|
ip->ip_len += hlen;
|
||||||
HTONS(ip->ip_len);
|
ip->ip_len = htons(ip->ip_len);
|
||||||
HTONS(ip->ip_off);
|
ip->ip_off = htons(ip->ip_off);
|
||||||
|
|
||||||
/* Deliver packet to divert input routine */
|
/* Deliver packet to divert input routine */
|
||||||
ip_divert_cookie = divert_cookie;
|
ip_divert_cookie = divert_cookie;
|
||||||
|
@ -1661,8 +1661,8 @@ encap_send(ip, vifp, m)
|
|||||||
*/
|
*/
|
||||||
ip = (struct ip *)((caddr_t)ip_copy + sizeof(multicast_encap_iphdr));
|
ip = (struct ip *)((caddr_t)ip_copy + sizeof(multicast_encap_iphdr));
|
||||||
--ip->ip_ttl;
|
--ip->ip_ttl;
|
||||||
HTONS(ip->ip_len);
|
ip->ip_len = htons(ip->ip_len);
|
||||||
HTONS(ip->ip_off);
|
ip->ip_off = htons(ip->ip_off);
|
||||||
ip->ip_sum = 0;
|
ip->ip_sum = 0;
|
||||||
mb_copy->m_data += sizeof(multicast_encap_iphdr);
|
mb_copy->m_data += sizeof(multicast_encap_iphdr);
|
||||||
ip->ip_sum = in_cksum(mb_copy, ip->ip_hl << 2);
|
ip->ip_sum = in_cksum(mb_copy, ip->ip_hl << 2);
|
||||||
|
@ -513,8 +513,8 @@ ip_output(m0, opt, ro, flags, imo)
|
|||||||
m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
|
m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
HTONS(ip->ip_len);
|
ip->ip_len = htons(ip->ip_len);
|
||||||
HTONS(ip->ip_off);
|
ip->ip_off = htons(ip->ip_off);
|
||||||
|
|
||||||
error = ipsec4_output(&state, sp, flags);
|
error = ipsec4_output(&state, sp, flags);
|
||||||
|
|
||||||
@ -573,8 +573,8 @@ ip_output(m0, opt, ro, flags, imo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* make it flipped, again. */
|
/* make it flipped, again. */
|
||||||
NTOHS(ip->ip_len);
|
ip->ip_len = ntohs(ip->ip_len);
|
||||||
NTOHS(ip->ip_off);
|
ip->ip_off = ntohs(ip->ip_off);
|
||||||
skip_ipsec:
|
skip_ipsec:
|
||||||
#endif /*IPSEC*/
|
#endif /*IPSEC*/
|
||||||
|
|
||||||
@ -681,8 +681,8 @@ ip_output(m0, opt, ro, flags, imo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Restore packet header fields to original values */
|
/* Restore packet header fields to original values */
|
||||||
HTONS(ip->ip_len);
|
ip->ip_len = htons(ip->ip_len);
|
||||||
HTONS(ip->ip_off);
|
ip->ip_off = htons(ip->ip_off);
|
||||||
|
|
||||||
/* Deliver packet to divert input routine */
|
/* Deliver packet to divert input routine */
|
||||||
ip_divert_cookie = divert_cookie;
|
ip_divert_cookie = divert_cookie;
|
||||||
@ -755,8 +755,8 @@ ip_output(m0, opt, ro, flags, imo)
|
|||||||
}
|
}
|
||||||
m->m_pkthdr.csum_flags |=
|
m->m_pkthdr.csum_flags |=
|
||||||
CSUM_IP_CHECKED | CSUM_IP_VALID;
|
CSUM_IP_CHECKED | CSUM_IP_VALID;
|
||||||
HTONS(ip->ip_len);
|
ip->ip_len = htons(ip->ip_len);
|
||||||
HTONS(ip->ip_off);
|
ip->ip_off = htons(ip->ip_off);
|
||||||
ip_input(m);
|
ip_input(m);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
@ -837,8 +837,8 @@ ip_output(m0, opt, ro, flags, imo)
|
|||||||
*/
|
*/
|
||||||
if ((u_short)ip->ip_len <= ifp->if_mtu ||
|
if ((u_short)ip->ip_len <= ifp->if_mtu ||
|
||||||
ifp->if_hwassist & CSUM_FRAGMENT) {
|
ifp->if_hwassist & CSUM_FRAGMENT) {
|
||||||
HTONS(ip->ip_len);
|
ip->ip_len = htons(ip->ip_len);
|
||||||
HTONS(ip->ip_off);
|
ip->ip_off = htons(ip->ip_off);
|
||||||
ip->ip_sum = 0;
|
ip->ip_sum = 0;
|
||||||
if (sw_csum & CSUM_DELAY_IP) {
|
if (sw_csum & CSUM_DELAY_IP) {
|
||||||
if (ip->ip_vhl == IP_VHL_BORING) {
|
if (ip->ip_vhl == IP_VHL_BORING) {
|
||||||
@ -943,7 +943,7 @@ ip_output(m0, opt, ro, flags, imo)
|
|||||||
m->m_pkthdr.len = mhlen + len;
|
m->m_pkthdr.len = mhlen + len;
|
||||||
m->m_pkthdr.rcvif = (struct ifnet *)0;
|
m->m_pkthdr.rcvif = (struct ifnet *)0;
|
||||||
m->m_pkthdr.csum_flags = m0->m_pkthdr.csum_flags;
|
m->m_pkthdr.csum_flags = m0->m_pkthdr.csum_flags;
|
||||||
HTONS(mhip->ip_off);
|
mhip->ip_off = htons(mhip->ip_off);
|
||||||
mhip->ip_sum = 0;
|
mhip->ip_sum = 0;
|
||||||
if (sw_csum & CSUM_DELAY_IP) {
|
if (sw_csum & CSUM_DELAY_IP) {
|
||||||
if (mhip->ip_vhl == IP_VHL_BORING) {
|
if (mhip->ip_vhl == IP_VHL_BORING) {
|
||||||
@ -972,7 +972,7 @@ ip_output(m0, opt, ro, flags, imo)
|
|||||||
m->m_pkthdr.len = hlen + firstlen;
|
m->m_pkthdr.len = hlen + firstlen;
|
||||||
ip->ip_len = htons((u_short)m->m_pkthdr.len);
|
ip->ip_len = htons((u_short)m->m_pkthdr.len);
|
||||||
ip->ip_off |= IP_MF;
|
ip->ip_off |= IP_MF;
|
||||||
HTONS(ip->ip_off);
|
ip->ip_off = htons(ip->ip_off);
|
||||||
ip->ip_sum = 0;
|
ip->ip_sum = 0;
|
||||||
if (sw_csum & CSUM_DELAY_IP) {
|
if (sw_csum & CSUM_DELAY_IP) {
|
||||||
if (ip->ip_vhl == IP_VHL_BORING) {
|
if (ip->ip_vhl == IP_VHL_BORING) {
|
||||||
@ -1950,8 +1950,8 @@ ip_mloopback(ifp, m, dst, hlen)
|
|||||||
* than the interface's MTU. Can this possibly matter?
|
* than the interface's MTU. Can this possibly matter?
|
||||||
*/
|
*/
|
||||||
ip = mtod(copym, struct ip *);
|
ip = mtod(copym, struct ip *);
|
||||||
HTONS(ip->ip_len);
|
ip->ip_len = htons(ip->ip_len);
|
||||||
HTONS(ip->ip_off);
|
ip->ip_off = htons(ip->ip_off);
|
||||||
ip->ip_sum = 0;
|
ip->ip_sum = 0;
|
||||||
if (ip->ip_vhl == IP_VHL_BORING) {
|
if (ip->ip_vhl == IP_VHL_BORING) {
|
||||||
ip->ip_sum = in_cksum_hdr(ip);
|
ip->ip_sum = in_cksum_hdr(ip);
|
||||||
|
@ -424,7 +424,7 @@ tcp_input(m, off0)
|
|||||||
len = sizeof (struct ip) + tlen;
|
len = sizeof (struct ip) + tlen;
|
||||||
bzero(ipov->ih_x1, sizeof(ipov->ih_x1));
|
bzero(ipov->ih_x1, sizeof(ipov->ih_x1));
|
||||||
ipov->ih_len = (u_short)tlen;
|
ipov->ih_len = (u_short)tlen;
|
||||||
HTONS(ipov->ih_len);
|
ipov->ih_len = htons(ipov->ih_len);
|
||||||
th->th_sum = in_cksum(m, len);
|
th->th_sum = in_cksum(m, len);
|
||||||
}
|
}
|
||||||
if (th->th_sum) {
|
if (th->th_sum) {
|
||||||
@ -486,10 +486,10 @@ tcp_input(m, off0)
|
|||||||
/*
|
/*
|
||||||
* Convert TCP protocol specific fields to host format.
|
* Convert TCP protocol specific fields to host format.
|
||||||
*/
|
*/
|
||||||
NTOHL(th->th_seq);
|
th->th_seq = ntohl(th->th_seq);
|
||||||
NTOHL(th->th_ack);
|
th->th_ack = ntohl(th->th_ack);
|
||||||
NTOHS(th->th_win);
|
th->th_win = ntohs(th->th_win);
|
||||||
NTOHS(th->th_urp);
|
th->th_urp = ntohs(th->th_urp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Delay droping TCP, IP headers, IPv6 ext headers, and TCP options,
|
* Delay droping TCP, IP headers, IPv6 ext headers, and TCP options,
|
||||||
@ -2246,7 +2246,7 @@ tcp_dooptions(to, cp, cnt, is_syn)
|
|||||||
to->to_flags |= TOF_MSS;
|
to->to_flags |= TOF_MSS;
|
||||||
bcopy((char *)cp + 2,
|
bcopy((char *)cp + 2,
|
||||||
(char *)&to->to_mss, sizeof(to->to_mss));
|
(char *)&to->to_mss, sizeof(to->to_mss));
|
||||||
NTOHS(to->to_mss);
|
to->to_mss = ntohs(to->to_mss);
|
||||||
break;
|
break;
|
||||||
case TCPOPT_WINDOW:
|
case TCPOPT_WINDOW:
|
||||||
if (optlen != TCPOLEN_WINDOW)
|
if (optlen != TCPOLEN_WINDOW)
|
||||||
@ -2262,10 +2262,10 @@ tcp_dooptions(to, cp, cnt, is_syn)
|
|||||||
to->to_flags |= TOF_TS;
|
to->to_flags |= TOF_TS;
|
||||||
bcopy((char *)cp + 2,
|
bcopy((char *)cp + 2,
|
||||||
(char *)&to->to_tsval, sizeof(to->to_tsval));
|
(char *)&to->to_tsval, sizeof(to->to_tsval));
|
||||||
NTOHL(to->to_tsval);
|
to->to_tsval = ntohl(to->to_tsval);
|
||||||
bcopy((char *)cp + 6,
|
bcopy((char *)cp + 6,
|
||||||
(char *)&to->to_tsecr, sizeof(to->to_tsecr));
|
(char *)&to->to_tsecr, sizeof(to->to_tsecr));
|
||||||
NTOHL(to->to_tsecr);
|
to->to_tsecr = ntohl(to->to_tsecr);
|
||||||
break;
|
break;
|
||||||
case TCPOPT_CC:
|
case TCPOPT_CC:
|
||||||
if (optlen != TCPOLEN_CC)
|
if (optlen != TCPOLEN_CC)
|
||||||
@ -2273,7 +2273,7 @@ tcp_dooptions(to, cp, cnt, is_syn)
|
|||||||
to->to_flags |= TOF_CC;
|
to->to_flags |= TOF_CC;
|
||||||
bcopy((char *)cp + 2,
|
bcopy((char *)cp + 2,
|
||||||
(char *)&to->to_cc, sizeof(to->to_cc));
|
(char *)&to->to_cc, sizeof(to->to_cc));
|
||||||
NTOHL(to->to_cc);
|
to->to_cc = ntohl(to->to_cc);
|
||||||
break;
|
break;
|
||||||
case TCPOPT_CCNEW:
|
case TCPOPT_CCNEW:
|
||||||
if (optlen != TCPOLEN_CC)
|
if (optlen != TCPOLEN_CC)
|
||||||
@ -2283,7 +2283,7 @@ tcp_dooptions(to, cp, cnt, is_syn)
|
|||||||
to->to_flags |= TOF_CCNEW;
|
to->to_flags |= TOF_CCNEW;
|
||||||
bcopy((char *)cp + 2,
|
bcopy((char *)cp + 2,
|
||||||
(char *)&to->to_cc, sizeof(to->to_cc));
|
(char *)&to->to_cc, sizeof(to->to_cc));
|
||||||
NTOHL(to->to_cc);
|
to->to_cc = ntohl(to->to_cc);
|
||||||
break;
|
break;
|
||||||
case TCPOPT_CCECHO:
|
case TCPOPT_CCECHO:
|
||||||
if (optlen != TCPOLEN_CC)
|
if (optlen != TCPOLEN_CC)
|
||||||
@ -2293,7 +2293,7 @@ tcp_dooptions(to, cp, cnt, is_syn)
|
|||||||
to->to_flags |= TOF_CCECHO;
|
to->to_flags |= TOF_CCECHO;
|
||||||
bcopy((char *)cp + 2,
|
bcopy((char *)cp + 2,
|
||||||
(char *)&to->to_ccecho, sizeof(to->to_ccecho));
|
(char *)&to->to_ccecho, sizeof(to->to_ccecho));
|
||||||
NTOHL(to->to_ccecho);
|
to->to_ccecho = ntohl(to->to_ccecho);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
continue;
|
continue;
|
||||||
|
@ -424,7 +424,7 @@ tcp_input(m, off0)
|
|||||||
len = sizeof (struct ip) + tlen;
|
len = sizeof (struct ip) + tlen;
|
||||||
bzero(ipov->ih_x1, sizeof(ipov->ih_x1));
|
bzero(ipov->ih_x1, sizeof(ipov->ih_x1));
|
||||||
ipov->ih_len = (u_short)tlen;
|
ipov->ih_len = (u_short)tlen;
|
||||||
HTONS(ipov->ih_len);
|
ipov->ih_len = htons(ipov->ih_len);
|
||||||
th->th_sum = in_cksum(m, len);
|
th->th_sum = in_cksum(m, len);
|
||||||
}
|
}
|
||||||
if (th->th_sum) {
|
if (th->th_sum) {
|
||||||
@ -486,10 +486,10 @@ tcp_input(m, off0)
|
|||||||
/*
|
/*
|
||||||
* Convert TCP protocol specific fields to host format.
|
* Convert TCP protocol specific fields to host format.
|
||||||
*/
|
*/
|
||||||
NTOHL(th->th_seq);
|
th->th_seq = ntohl(th->th_seq);
|
||||||
NTOHL(th->th_ack);
|
th->th_ack = ntohl(th->th_ack);
|
||||||
NTOHS(th->th_win);
|
th->th_win = ntohs(th->th_win);
|
||||||
NTOHS(th->th_urp);
|
th->th_urp = ntohs(th->th_urp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Delay droping TCP, IP headers, IPv6 ext headers, and TCP options,
|
* Delay droping TCP, IP headers, IPv6 ext headers, and TCP options,
|
||||||
@ -2246,7 +2246,7 @@ tcp_dooptions(to, cp, cnt, is_syn)
|
|||||||
to->to_flags |= TOF_MSS;
|
to->to_flags |= TOF_MSS;
|
||||||
bcopy((char *)cp + 2,
|
bcopy((char *)cp + 2,
|
||||||
(char *)&to->to_mss, sizeof(to->to_mss));
|
(char *)&to->to_mss, sizeof(to->to_mss));
|
||||||
NTOHS(to->to_mss);
|
to->to_mss = ntohs(to->to_mss);
|
||||||
break;
|
break;
|
||||||
case TCPOPT_WINDOW:
|
case TCPOPT_WINDOW:
|
||||||
if (optlen != TCPOLEN_WINDOW)
|
if (optlen != TCPOLEN_WINDOW)
|
||||||
@ -2262,10 +2262,10 @@ tcp_dooptions(to, cp, cnt, is_syn)
|
|||||||
to->to_flags |= TOF_TS;
|
to->to_flags |= TOF_TS;
|
||||||
bcopy((char *)cp + 2,
|
bcopy((char *)cp + 2,
|
||||||
(char *)&to->to_tsval, sizeof(to->to_tsval));
|
(char *)&to->to_tsval, sizeof(to->to_tsval));
|
||||||
NTOHL(to->to_tsval);
|
to->to_tsval = ntohl(to->to_tsval);
|
||||||
bcopy((char *)cp + 6,
|
bcopy((char *)cp + 6,
|
||||||
(char *)&to->to_tsecr, sizeof(to->to_tsecr));
|
(char *)&to->to_tsecr, sizeof(to->to_tsecr));
|
||||||
NTOHL(to->to_tsecr);
|
to->to_tsecr = ntohl(to->to_tsecr);
|
||||||
break;
|
break;
|
||||||
case TCPOPT_CC:
|
case TCPOPT_CC:
|
||||||
if (optlen != TCPOLEN_CC)
|
if (optlen != TCPOLEN_CC)
|
||||||
@ -2273,7 +2273,7 @@ tcp_dooptions(to, cp, cnt, is_syn)
|
|||||||
to->to_flags |= TOF_CC;
|
to->to_flags |= TOF_CC;
|
||||||
bcopy((char *)cp + 2,
|
bcopy((char *)cp + 2,
|
||||||
(char *)&to->to_cc, sizeof(to->to_cc));
|
(char *)&to->to_cc, sizeof(to->to_cc));
|
||||||
NTOHL(to->to_cc);
|
to->to_cc = ntohl(to->to_cc);
|
||||||
break;
|
break;
|
||||||
case TCPOPT_CCNEW:
|
case TCPOPT_CCNEW:
|
||||||
if (optlen != TCPOLEN_CC)
|
if (optlen != TCPOLEN_CC)
|
||||||
@ -2283,7 +2283,7 @@ tcp_dooptions(to, cp, cnt, is_syn)
|
|||||||
to->to_flags |= TOF_CCNEW;
|
to->to_flags |= TOF_CCNEW;
|
||||||
bcopy((char *)cp + 2,
|
bcopy((char *)cp + 2,
|
||||||
(char *)&to->to_cc, sizeof(to->to_cc));
|
(char *)&to->to_cc, sizeof(to->to_cc));
|
||||||
NTOHL(to->to_cc);
|
to->to_cc = ntohl(to->to_cc);
|
||||||
break;
|
break;
|
||||||
case TCPOPT_CCECHO:
|
case TCPOPT_CCECHO:
|
||||||
if (optlen != TCPOLEN_CC)
|
if (optlen != TCPOLEN_CC)
|
||||||
@ -2293,7 +2293,7 @@ tcp_dooptions(to, cp, cnt, is_syn)
|
|||||||
to->to_flags |= TOF_CCECHO;
|
to->to_flags |= TOF_CCECHO;
|
||||||
bcopy((char *)cp + 2,
|
bcopy((char *)cp + 2,
|
||||||
(char *)&to->to_ccecho, sizeof(to->to_ccecho));
|
(char *)&to->to_ccecho, sizeof(to->to_ccecho));
|
||||||
NTOHL(to->to_ccecho);
|
to->to_ccecho = ntohl(to->to_ccecho);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
continue;
|
continue;
|
||||||
|
@ -756,8 +756,8 @@ ip6_fw_chk(struct ip6_hdr **pip6,
|
|||||||
|
|
||||||
ti.ip6 = *ip6;
|
ti.ip6 = *ip6;
|
||||||
ti.th = *tcp;
|
ti.th = *tcp;
|
||||||
NTOHL(ti.th.th_seq);
|
ti.th.th_seq = ntohl(ti.th.th_seq);
|
||||||
NTOHL(ti.th.th_ack);
|
ti.th.th_ack = ntohl(ti.th.th_ack);
|
||||||
ti.ip6.ip6_nxt = IPPROTO_TCP;
|
ti.ip6.ip6_nxt = IPPROTO_TCP;
|
||||||
if (ti.th.th_flags & TH_ACK) {
|
if (ti.th.th_flags & TH_ACK) {
|
||||||
ack = 0;
|
ack = 0;
|
||||||
|
@ -269,7 +269,7 @@ nd6_ra_input(m, off, icmp6len)
|
|||||||
dr0.advints_lost = 0; /* Mobile IPv6 */
|
dr0.advints_lost = 0; /* Mobile IPv6 */
|
||||||
/* unspecified or not? (RFC 2461 6.3.4) */
|
/* unspecified or not? (RFC 2461 6.3.4) */
|
||||||
if (advreachable) {
|
if (advreachable) {
|
||||||
NTOHL(advreachable);
|
advreachable = ntohl(advreachable);
|
||||||
if (advreachable <= MAX_REACHABLE_TIME &&
|
if (advreachable <= MAX_REACHABLE_TIME &&
|
||||||
ndi->basereachable != advreachable) {
|
ndi->basereachable != advreachable) {
|
||||||
ndi->basereachable = advreachable;
|
ndi->basereachable = advreachable;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*-
|
||||||
* Copyright (c) 1987, 1991, 1993
|
* Copyright (c) 1987, 1991, 1993
|
||||||
* The Regents of the University of California. All rights reserved.
|
* The Regents of the University of California. All rights reserved.
|
||||||
*
|
*
|
||||||
@ -35,8 +35,10 @@
|
|||||||
* $FreeBSD$
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _ENDIAN_H_
|
#ifndef _MACHINE_ENDIAN_H_
|
||||||
#define _ENDIAN_H_
|
#define _MACHINE_ENDIAN_H_
|
||||||
|
|
||||||
|
#include <machine/ansi.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define the order of 32-bit words in 64-bit words.
|
* Define the order of 32-bit words in 64-bit words.
|
||||||
@ -44,53 +46,32 @@
|
|||||||
#define _QUAD_HIGHWORD 0
|
#define _QUAD_HIGHWORD 0
|
||||||
#define _QUAD_LOWWORD 1
|
#define _QUAD_LOWWORD 1
|
||||||
|
|
||||||
#ifndef _POSIX_SOURCE
|
|
||||||
/*
|
/*
|
||||||
* Definitions for byte order, according to byte significance from low
|
* Definitions for byte order, according to byte significance from low
|
||||||
* address to high.
|
* address to high.
|
||||||
*/
|
*/
|
||||||
|
#ifndef _POSIX_SOURCE
|
||||||
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
|
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
|
||||||
#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
|
#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
|
||||||
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
|
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
|
||||||
|
|
||||||
#define BYTE_ORDER BIG_ENDIAN
|
#define BYTE_ORDER BIG_ENDIAN
|
||||||
|
#endif /* !_POSIX_SOURCE */
|
||||||
|
|
||||||
#ifndef _KERNEL
|
#ifndef _KERNEL
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#endif
|
|
||||||
#include <machine/ansi.h>
|
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
__uint32_t htonl __P((__uint32_t));
|
__uint32_t __htonl __P((__uint32_t));
|
||||||
__uint16_t htons __P((__uint16_t));
|
__uint16_t __htons __P((__uint16_t));
|
||||||
__uint32_t ntohl __P((__uint32_t));
|
__uint32_t __ntohl __P((__uint32_t));
|
||||||
__uint16_t ntohs __P((__uint16_t));
|
__uint16_t __ntohs __P((__uint16_t));
|
||||||
__uint16_t bswap16 __P((__uint16_t));
|
|
||||||
__uint32_t bswap32 __P((__uint32_t));
|
|
||||||
__uint64_t bswap64 __P((__uint64_t));
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
#endif /* _KERNEL */
|
||||||
|
|
||||||
/*
|
#define __htonl(x) (x)
|
||||||
* Macros for network/external number representation conversion.
|
#define __htons(x) (x)
|
||||||
*/
|
#define __ntohl(x) (x)
|
||||||
#if BYTE_ORDER == BIG_ENDIAN && !defined(lint)
|
#define __ntohs(x) (x)
|
||||||
#define ntohl(x) (x)
|
|
||||||
#define ntohs(x) (x)
|
|
||||||
#define htonl(x) (x)
|
|
||||||
#define htons(x) (x)
|
|
||||||
|
|
||||||
#define NTOHL(x) (x)
|
#endif /* !_MACHINE_ENDIAN_H_ */
|
||||||
#define NTOHS(x) (x)
|
|
||||||
#define HTONL(x) (x)
|
|
||||||
#define HTONS(x) (x)
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define NTOHL(x) (x) = ntohl((__uint32_t)(x))
|
|
||||||
#define NTOHS(x) (x) = ntohs((__uint16_t)(x))
|
|
||||||
#define HTONL(x) (x) = htonl((__uint32_t)(x))
|
|
||||||
#define HTONS(x) (x) = htons((__uint16_t)(x))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* !_POSIX_SOURCE */
|
|
||||||
#endif /* !_ENDIAN_H_ */
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*-
|
||||||
* Copyright (c) 1987, 1991, 1993
|
* Copyright (c) 1987, 1991, 1993
|
||||||
* The Regents of the University of California. All rights reserved.
|
* The Regents of the University of California. All rights reserved.
|
||||||
*
|
*
|
||||||
@ -10,6 +10,13 @@
|
|||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* 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
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@ -30,58 +37,29 @@
|
|||||||
#ifndef _MACHINE_ENDIAN_H_
|
#ifndef _MACHINE_ENDIAN_H_
|
||||||
#define _MACHINE_ENDIAN_H_
|
#define _MACHINE_ENDIAN_H_
|
||||||
|
|
||||||
|
#include <machine/ansi.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define the order of 32-bit words in 64-bit words.
|
* Define the order of 32-bit words in 64-bit words.
|
||||||
*/
|
*/
|
||||||
#define _QUAD_HIGHWORD 0
|
#define _QUAD_HIGHWORD 0
|
||||||
#define _QUAD_LOWWORD 1
|
#define _QUAD_LOWWORD 1
|
||||||
|
|
||||||
#ifndef _POSIX_SOURCE
|
|
||||||
/*
|
/*
|
||||||
* Definitions for byte order, according to byte significance from low
|
* Definitions for byte order, according to byte significance from low
|
||||||
* address to high.
|
* address to high.
|
||||||
*/
|
*/
|
||||||
|
#ifndef _POSIX_SOURCE
|
||||||
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
|
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
|
||||||
#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
|
#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
|
||||||
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
|
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
|
||||||
|
|
||||||
#define BYTE_ORDER BIG_ENDIAN
|
#define BYTE_ORDER BIG_ENDIAN
|
||||||
|
|
||||||
#ifndef _KERNEL
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
#endif
|
|
||||||
#include <machine/ansi.h>
|
|
||||||
|
|
||||||
__BEGIN_DECLS
|
|
||||||
__uint32_t htonl __P((__uint32_t));
|
|
||||||
__uint16_t htons __P((__uint16_t));
|
|
||||||
__uint32_t ntohl __P((__uint32_t));
|
|
||||||
__uint16_t ntohs __P((__uint16_t));
|
|
||||||
__uint16_t bswap16 __P((__uint16_t));
|
|
||||||
__uint32_t bswap32 __P((__uint32_t));
|
|
||||||
__uint64_t bswap64 __P((__uint64_t));
|
|
||||||
__END_DECLS
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Macros for network/external number representation conversion.
|
|
||||||
*/
|
|
||||||
#if BYTE_ORDER == BIG_ENDIAN && !defined(lint)
|
|
||||||
#define ntohl(x) (x)
|
|
||||||
#define ntohs(x) (x)
|
|
||||||
#define htonl(x) (x)
|
|
||||||
#define htons(x) (x)
|
|
||||||
|
|
||||||
#define NTOHL(x)
|
|
||||||
#define NTOHS(x)
|
|
||||||
#define HTONL(x)
|
|
||||||
#define HTONS(x)
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define NTOHL(x) (x) = ntohl((in_addr_t)x)
|
|
||||||
#define NTOHS(x) (x) = ntohs((in_port_t)x)
|
|
||||||
#define HTONL(x) (x) = htonl((in_addr_t)x)
|
|
||||||
#define HTONS(x) (x) = htons((in_port_t)x)
|
|
||||||
#endif
|
|
||||||
#endif /* !_POSIX_SOURCE */
|
#endif /* !_POSIX_SOURCE */
|
||||||
|
|
||||||
|
#define __htonl(x) (x)
|
||||||
|
#define __htons(x) (x)
|
||||||
|
#define __ntohl(x) (x)
|
||||||
|
#define __ntohs(x) (x)
|
||||||
|
|
||||||
#endif /* !_MACHINE_ENDIAN_H_ */
|
#endif /* !_MACHINE_ENDIAN_H_ */
|
||||||
|
@ -50,14 +50,14 @@
|
|||||||
((mag) & 0xffff) )
|
((mag) & 0xffff) )
|
||||||
|
|
||||||
#define N_GETMAGIC_NET(ex) \
|
#define N_GETMAGIC_NET(ex) \
|
||||||
(ntohl((ex).a_midmag) & 0xffff)
|
(__ntohl((ex).a_midmag) & 0xffff)
|
||||||
#define N_GETMID_NET(ex) \
|
#define N_GETMID_NET(ex) \
|
||||||
((ntohl((ex).a_midmag) >> 16) & 0x03ff)
|
((__ntohl((ex).a_midmag) >> 16) & 0x03ff)
|
||||||
#define N_GETFLAG_NET(ex) \
|
#define N_GETFLAG_NET(ex) \
|
||||||
((ntohl((ex).a_midmag) >> 26) & 0x3f)
|
((__ntohl((ex).a_midmag) >> 26) & 0x3f)
|
||||||
#define N_SETMAGIC_NET(ex,mag,mid,flag) \
|
#define N_SETMAGIC_NET(ex,mag,mid,flag) \
|
||||||
( (ex).a_midmag = htonl( (((flag)&0x3f)<<26) | (((mid)&0x03ff)<<16) | \
|
( (ex).a_midmag = __htonl( (((flag)&0x3f)<<26) | (((mid)&0x03ff)<<16) \
|
||||||
(((mag)&0xffff)) ) )
|
| (((mag)&0xffff)) ) )
|
||||||
|
|
||||||
#define N_ALIGN(ex,x) \
|
#define N_ALIGN(ex,x) \
|
||||||
(N_GETMAGIC(ex) == ZMAGIC || N_GETMAGIC(ex) == QMAGIC || \
|
(N_GETMAGIC(ex) == ZMAGIC || N_GETMAGIC(ex) == QMAGIC || \
|
||||||
|
@ -48,23 +48,23 @@
|
|||||||
#define htoleq(x) ((int64_t)(x))
|
#define htoleq(x) ((int64_t)(x))
|
||||||
#define letohq(x) ((int64_t)(x))
|
#define letohq(x) ((int64_t)(x))
|
||||||
|
|
||||||
#define htobes(x) (htons(x))
|
#define htobes(x) (__htons(x))
|
||||||
#define betohs(x) (ntohs(x))
|
#define betohs(x) (__ntohs(x))
|
||||||
#define htobel(x) (htonl(x))
|
#define htobel(x) (__htonl(x))
|
||||||
#define betohl(x) (ntohl(x))
|
#define betohl(x) (__ntohl(x))
|
||||||
|
|
||||||
static __inline int64_t
|
static __inline int64_t
|
||||||
htobeq(int64_t x)
|
htobeq(int64_t x)
|
||||||
{
|
{
|
||||||
return (int64_t)htonl((u_int32_t)(x >> 32)) |
|
return (int64_t)__htonl((u_int32_t)(x >> 32)) |
|
||||||
(int64_t)htonl((u_int32_t)(x & 0xffffffff)) << 32;
|
(int64_t)__htonl((u_int32_t)(x & 0xffffffff)) << 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline int64_t
|
static __inline int64_t
|
||||||
betohq(int64_t x)
|
betohq(int64_t x)
|
||||||
{
|
{
|
||||||
return (int64_t)ntohl((u_int32_t)(x >> 32)) |
|
return (int64_t)__ntohl((u_int32_t)(x >> 32)) |
|
||||||
(int64_t)ntohl((u_int32_t)(x & 0xffffffff)) << 32;
|
(int64_t)__ntohl((u_int32_t)(x & 0xffffffff)) << 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* (BYTE_ORDER == LITTLE_ENDIAN) */
|
#else /* (BYTE_ORDER == LITTLE_ENDIAN) */
|
||||||
|
@ -188,6 +188,30 @@
|
|||||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Kernel exposed versions of byteorder(3) functions.
|
||||||
|
*
|
||||||
|
* XXX this section should only be defined in the kernel, but some userland
|
||||||
|
* software utilizes it.
|
||||||
|
*/
|
||||||
|
#ifndef _BYTEORDER_FUNC_DEFINED
|
||||||
|
#define _BYTEORDER_FUNC_DEFINED
|
||||||
|
#define htonl(x) __htonl(x)
|
||||||
|
#define htons(x) __htons(x)
|
||||||
|
#define ntohl(x) __ntohl(x)
|
||||||
|
#define ntohs(x) __ntohs(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XXX deprecated uppercase variants for byteorder(3) functions.
|
||||||
|
*/
|
||||||
|
#ifndef _POSIX_SOURCE
|
||||||
|
#define NTOHL(x) ((x) = __ntohl(x))
|
||||||
|
#define NTOHS(x) ((x) = __ntohs(x))
|
||||||
|
#define HTONL(x) ((x) = __htonl(x))
|
||||||
|
#define HTONS(x) ((x) = __htons(x))
|
||||||
|
#endif /* _POSIX_SOURCE */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Constants for setting the parameters of the kernel memory allocator.
|
* Constants for setting the parameters of the kernel memory allocator.
|
||||||
*
|
*
|
||||||
|
@ -46,6 +46,7 @@
|
|||||||
|
|
||||||
/* Machine type dependent parameters. */
|
/* Machine type dependent parameters. */
|
||||||
#include <sys/stdint.h> /* includes <machine/ansi.h> */
|
#include <sys/stdint.h> /* includes <machine/ansi.h> */
|
||||||
|
#include <machine/endian.h>
|
||||||
#include <machine/types.h>
|
#include <machine/types.h>
|
||||||
|
|
||||||
#ifndef _POSIX_SOURCE
|
#ifndef _POSIX_SOURCE
|
||||||
@ -122,12 +123,6 @@ typedef u_int32_t dev_t; /* device number */
|
|||||||
|
|
||||||
#endif /* !_KERNEL */
|
#endif /* !_KERNEL */
|
||||||
|
|
||||||
/*
|
|
||||||
* XXX: Deprecated;
|
|
||||||
* byteorder(3) functions now defined in <arpa/inet.h>.
|
|
||||||
*/
|
|
||||||
#include <machine/endian.h>
|
|
||||||
|
|
||||||
#ifdef _BSD_CLOCK_T_
|
#ifdef _BSD_CLOCK_T_
|
||||||
typedef _BSD_CLOCK_T_ clock_t;
|
typedef _BSD_CLOCK_T_ clock_t;
|
||||||
#undef _BSD_CLOCK_T_
|
#undef _BSD_CLOCK_T_
|
||||||
@ -143,18 +138,6 @@ typedef _BSD_FFLAGS_T_ fflags_t; /* file flags */
|
|||||||
#undef _BSD_FFLAGS_T_
|
#undef _BSD_FFLAGS_T_
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* XXX: Deprecated; now defined in <arpa/inet.h>. */
|
|
||||||
#ifndef _IN_ADDR_T_DECLARED_
|
|
||||||
typedef __uint32_t in_addr_t;
|
|
||||||
#define _IN_ADDR_T_DECLARED_
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* XXX: Deprecated; now defined in <arpa/inet.h>. */
|
|
||||||
#ifndef _IN_PORT_T_DECLARED_
|
|
||||||
typedef __uint16_t in_port_t;
|
|
||||||
#define _IN_PORT_T_DECLARED_
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _BSD_SIZE_T_
|
#ifdef _BSD_SIZE_T_
|
||||||
typedef _BSD_SIZE_T_ size_t;
|
typedef _BSD_SIZE_T_ size_t;
|
||||||
#undef _BSD_SIZE_T_
|
#undef _BSD_SIZE_T_
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "locate.h"
|
#include "locate.h"
|
||||||
|
@ -40,6 +40,8 @@ static char sccsid[] = "@(#)yacc.y 8.1 (Berkeley) 6/6/93";
|
|||||||
static char rcsid[] = "$FreeBSD$";
|
static char rcsid[] = "$FreeBSD$";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <rune.h>
|
#include <rune.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$");
|
|||||||
static const char sccsid[] = "@(#)ctl_transact.c 8.1 (Berkeley) 6/6/93";
|
static const char sccsid[] = "@(#)ctl_transact.c 8.1 (Berkeley) 6/6/93";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <net/route.h>
|
#include <net/route.h>
|
||||||
#include <netipx/ipx.h>
|
#include <netipx/ipx.h>
|
||||||
#if defined(vax) || defined(pdp11)
|
#if defined(vax) || defined(pdp11)
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user