-/* $OpenBSD: dev_net.c,v 1.3 2002/03/14 03:15:51 millert Exp $ */
+/* $OpenBSD: dev_net.c,v 1.4 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: dev_net.c,v 1.4 1997/04/06 08:41:24 cgd Exp $ */
/*
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
-#include <netinet/in_systm.h>
#include <lib/libsa/stand.h>
#include <lib/libsa/net.h>
struct in_addr myip; /* my ip address */
struct in_addr rootip; /* root ip address */
struct in_addr gateip; /* swap ip address */
-n_long netmask; /* subnet or net mask */
+u_int32_t netmask; /* subnet or net mask */
char rootpath[FNAME_SIZE];
-/* $OpenBSD: net.c,v 1.1 2004/03/21 21:37:41 tom Exp $ */
+/* $OpenBSD: net.c,v 1.2 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: net.c,v 1.14 1996/10/13 02:29:02 christos Exp $ */
/*
#include <netinet/in.h>
#include <netinet/if_ether.h>
-#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include <netinet/udp.h>
* Like inet_addr() in the C library, but we only accept base-10.
* Return values are in network order.
*/
-n_long
+u_int32_t
inet_addr(char *cp)
{
u_long val;
/* Similar to inet_ntoa() */
char *
-intoa(n_long addr)
+intoa(u_int32_t addr)
{
char *cp;
u_int byte;
return s;
}
-n_long
+u_int32_t
ip_convertaddr(char *p)
{
#define IP_ANYADDR 0
- n_long addr = 0, n;
+ u_int32_t addr = 0, n;
if (p == (char *)0 || *p == '\0')
return IP_ANYADDR;
-/* $OpenBSD: net.c,v 1.1 2004/03/19 13:48:19 tom Exp $ */
+/* $OpenBSD: net.c,v 1.2 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: net.c,v 1.14 1996/10/13 02:29:02 christos Exp $ */
/*
#include <netinet/in.h>
#include <netinet/if_ether.h>
-#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include <netinet/udp.h>
* Like inet_addr() in the C library, but we only accept base-10.
* Return values are in network order.
*/
-n_long
+u_int32_t
inet_addr(char *cp)
{
u_long val;
/* Similar to inet_ntoa() */
char *
-intoa(n_long addr)
+intoa(u_int32_t addr)
{
char *cp;
u_int byte;
return s;
}
-n_long
+u_int32_t
ip_convertaddr(char *p)
{
#define IP_ANYADDR 0
- n_long addr = 0, n;
+ u_int32_t addr = 0, n;
if (p == (char *)0 || *p == '\0')
return IP_ANYADDR;
-/* $OpenBSD: dev_net.c,v 1.2 2013/10/29 21:49:07 miod Exp $ */
+/* $OpenBSD: dev_net.c,v 1.3 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: dev_net.c,v 1.26 2011/07/17 20:54:52 joerg Exp $ */
/*-
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
-#include <netinet/in_systm.h>
#include <lib/libkern/libkern.h>
net_getparams(int sock)
{
char buf[MAXHOSTNAMELEN];
- n_long smask;
+ u_int32_t smask;
#ifdef SUPPORT_BOOTP
/*
-/* $OpenBSD: arp.c,v 1.11 2003/08/11 06:23:09 deraadt Exp $ */
+/* $OpenBSD: arp.c,v 1.12 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: arp.c,v 1.15 1996/10/13 02:28:58 christos Exp $ */
/*
#include <netinet/in.h>
#include <netinet/if_ether.h>
-#include <netinet/in_systm.h>
#include "stand.h"
#include "net.h"
-/* $OpenBSD: bootp.c,v 1.13 2014/03/28 01:12:58 guenther Exp $ */
+/* $OpenBSD: bootp.c,v 1.14 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: bootp.c,v 1.10 1996/10/13 02:28:59 christos Exp $ */
/*
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
-#include <netinet/in_systm.h>
#include "stand.h"
#include "net.h"
#include "netif.h"
#include "bootp.h"
-static n_long nmask, smask;
+static u_int32_t nmask, smask;
static time_t bot;
-/* $OpenBSD: bootparam.c,v 1.11 2003/08/11 06:23:09 deraadt Exp $ */
+/* $OpenBSD: bootparam.c,v 1.12 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: bootparam.c,v 1.10 1996/10/14 21:16:55 thorpej Exp $ */
/*
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/in_systm.h>
#include <nfs/rpcv2.h>
#endif
struct in_addr bp_server_addr; /* net order */
-n_short bp_server_port; /* net order */
+u_int16_t bp_server_port; /* net order */
/*
* RPC definitions for bootparamd
u_int16_t port;
u_int32_t encap_len;
/* encapsulated data here */
- n_long capsule[64];
+ u_int32_t capsule[64];
} *repl;
struct {
- n_long h[RPC_HEADER_WORDS];
+ u_int32_t h[RPC_HEADER_WORDS];
struct args d;
} sdata;
struct {
- n_long h[RPC_HEADER_WORDS];
+ u_int32_t h[RPC_HEADER_WORDS];
struct repl d;
} rdata;
char *send_tail, *recv_head;
bp_getfile(int sockfd, char *key, struct in_addr *serv_addr, char *pathname)
{
struct {
- n_long h[RPC_HEADER_WORDS];
- n_long d[64];
+ u_int32_t h[RPC_HEADER_WORDS];
+ u_int32_t d[64];
} sdata;
struct {
- n_long h[RPC_HEADER_WORDS];
- n_long d[128];
+ u_int32_t h[RPC_HEADER_WORDS];
+ u_int32_t d[128];
} rdata;
char serv_name[FNAME_SIZE];
char *send_tail, *recv_head;
u_char *cp;
int32_t *ip;
union {
- n_long l; /* network order */
+ u_int32_t l; /* network order */
u_char c[4];
} uia;
u_char *cp;
int32_t *ip;
union {
- n_long l; /* network order */
+ u_int32_t l; /* network order */
u_char c[4];
} uia;
-/* $OpenBSD: ether.c,v 1.7 2003/08/11 06:23:09 deraadt Exp $ */
+/* $OpenBSD: ether.c,v 1.8 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: ether.c,v 1.8 1996/10/13 02:29:00 christos Exp $ */
/*
#include <netinet/in.h>
#include <netinet/if_ether.h>
-#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include "stand.h"
-/* $OpenBSD: globals.c,v 1.3 1996/09/23 14:18:54 mickey Exp $ */
+/* $OpenBSD: globals.c,v 1.4 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: globals.c,v 1.3 1995/09/18 21:19:27 pk Exp $ */
/*
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
-#include <netinet/in_systm.h>
#include "stand.h"
#include "net.h"
struct in_addr rootip; /* root ip address */
struct in_addr swapip; /* swap ip address */
struct in_addr gateip; /* swap ip address */
-n_long netmask = 0xffffff00; /* subnet or net mask */
+u_int32_t netmask = 0xffffff00; /* subnet or net mask */
-/* $OpenBSD: in_cksum.c,v 1.3 2003/08/11 06:23:09 deraadt Exp $ */
+/* $OpenBSD: in_cksum.c,v 1.4 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: in_cksum.c,v 1.3 1995/04/22 13:53:48 cgd Exp $ */
/*
#include <netinet/in.h>
#include <netinet/if_ether.h>
-#include <netinet/in_systm.h>
#include "stand.h"
#include "net.h"
-/* $OpenBSD: net.c,v 1.13 2003/08/11 06:23:09 deraadt Exp $ */
+/* $OpenBSD: net.c,v 1.14 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: net.c,v 1.14 1996/10/13 02:29:02 christos Exp $ */
/*
#include <netinet/in.h>
#include <netinet/if_ether.h>
-#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include <netinet/udp.h>
* Like inet_addr() in the C library, but we only accept base-10.
* Return values are in network order.
*/
-n_long
+u_int32_t
inet_addr(char *cp)
{
u_long val;
/* Similar to inet_ntoa() */
char *
-intoa(n_long addr)
+intoa(u_int32_t addr)
{
char *cp;
u_int byte;
return s;
}
-n_long
+u_int32_t
ip_convertaddr(char *p)
{
#define IP_ANYADDR 0
- n_long addr = 0, n;
+ u_int32_t addr = 0, n;
if (p == (char *)0 || *p == '\0')
return IP_ANYADDR;
-/* $OpenBSD: net.h,v 1.8 2014/03/28 01:12:58 guenther Exp $ */
+/* $OpenBSD: net.h,v 1.9 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: net.h,v 1.10 1995/10/20 00:46:30 cgd Exp $ */
/*
#define BA { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }
-/* Returns true if n_long's on the same net */
+/* Returns true if u_int32_t's on the same net */
#define SAMENET(a1, a2, m) ((a1.s_addr & m) == (a2.s_addr & m))
#define MACPY(s, d) bcopy((char *)s, (char *)d, 6)
extern struct in_addr swapip;
extern struct in_addr gateip;
extern struct in_addr nameip;
-extern n_long netmask;
+extern u_int32_t netmask;
extern int debug; /* defined in the machdep sources */
u_char *arpwhohas(struct iodesc *, struct in_addr);
void arp_reply(struct iodesc *, void *);
int rarp_getipaddress(int);
-n_long ip_convertaddr(char *);
+u_int32_t ip_convertaddr(char *);
/* Link functions: */
ssize_t sendether(struct iodesc *d, void *pkt, size_t len,
char *ether_sprintf(u_char *);
int in_cksum(void *, int);
char *inet_ntoa(struct in_addr);
-char *intoa(n_long); /* similar to inet_ntoa */
-n_long inet_addr(char *);
+char *intoa(u_int32_t); /* similar to inet_ntoa */
+u_int32_t inet_addr(char *);
/* Machine-dependent functions: */
time_t getsecs(void);
-/* $OpenBSD: netif.c,v 1.9 2012/12/05 23:20:23 deraadt Exp $ */
+/* $OpenBSD: netif.c,v 1.10 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: netif.c,v 1.7 1996/10/13 02:29:03 christos Exp $ */
/*
#include <sys/mount.h>
#include <netinet/in.h>
-#include <netinet/in_systm.h>
#include "stand.h"
#include "net.h"
-/* $OpenBSD: nfs.c,v 1.10 2003/08/11 06:23:09 deraadt Exp $ */
+/* $OpenBSD: nfs.c,v 1.11 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: nfs.c,v 1.19 1996/10/13 02:29:04 christos Exp $ */
/*-
#include <sys/stat.h>
#include <netinet/in.h>
-#include <netinet/in_systm.h>
#include "rpcv2.h"
#include "nfsv2.h"
/* Define our own NFS attributes without NQNFS stuff. */
struct nfsv2_fattrs {
- n_long fa_type;
- n_long fa_mode;
- n_long fa_nlink;
- n_long fa_uid;
- n_long fa_gid;
- n_long fa_size;
- n_long fa_blocksize;
- n_long fa_rdev;
- n_long fa_blocks;
- n_long fa_fsid;
- n_long fa_fileid;
+ u_int32_t fa_type;
+ u_int32_t fa_mode;
+ u_int32_t fa_nlink;
+ u_int32_t fa_uid;
+ u_int32_t fa_gid;
+ u_int32_t fa_size;
+ u_int32_t fa_blocksize;
+ u_int32_t fa_rdev;
+ u_int32_t fa_blocks;
+ u_int32_t fa_fsid;
+ u_int32_t fa_fileid;
struct nfsv2_time fa_atime;
struct nfsv2_time fa_mtime;
struct nfsv2_time fa_ctime;
struct nfs_read_args {
u_char fh[NFS_FHSIZE];
- n_long off;
- n_long len;
- n_long xxx; /* XXX what's this for? */
+ u_int32_t off;
+ u_int32_t len;
+ u_int32_t xxx; /* XXX what's this for? */
};
/* Data part of nfs rpc reply (also the largest thing we receive) */
#define NFSREAD_SIZE 1024
struct nfs_read_repl {
- n_long errno;
+ u_int32_t errno;
struct nfsv2_fattrs fa;
- n_long count;
+ u_int32_t count;
u_char data[NFSREAD_SIZE];
};
struct nfs_readlnk_repl {
- n_long errno;
- n_long len;
+ u_int32_t errno;
+ u_int32_t len;
char path[NFS_MAXPATHLEN];
};
{
int len;
struct args {
- n_long len;
+ u_int32_t len;
char path[FNAME_SIZE];
} *args;
struct repl {
- n_long errno;
+ u_int32_t errno;
u_char fh[NFS_FHSIZE];
} *repl;
struct {
- n_long h[RPC_HEADER_WORDS];
+ u_int32_t h[RPC_HEADER_WORDS];
struct args d;
} sdata;
struct {
- n_long h[RPC_HEADER_WORDS];
+ u_int32_t h[RPC_HEADER_WORDS];
struct repl d;
} rdata;
size_t cc;
int len, rlen;
struct args {
u_char fh[NFS_FHSIZE];
- n_long len;
+ u_int32_t len;
char name[FNAME_SIZE];
} *args;
struct repl {
- n_long errno;
+ u_int32_t errno;
u_char fh[NFS_FHSIZE];
struct nfsv2_fattrs fa;
} *repl;
struct {
- n_long h[RPC_HEADER_WORDS];
+ u_int32_t h[RPC_HEADER_WORDS];
struct args d;
} sdata;
struct {
- n_long h[RPC_HEADER_WORDS];
+ u_int32_t h[RPC_HEADER_WORDS];
struct repl d;
} rdata;
ssize_t cc;
nfs_readlink(struct nfs_iodesc *d, char *buf)
{
struct {
- n_long h[RPC_HEADER_WORDS];
+ u_int32_t h[RPC_HEADER_WORDS];
u_char fh[NFS_FHSIZE];
} sdata;
struct {
- n_long h[RPC_HEADER_WORDS];
+ u_int32_t h[RPC_HEADER_WORDS];
struct nfs_readlnk_repl d;
} rdata;
ssize_t cc;
struct nfs_read_args *args;
struct nfs_read_repl *repl;
struct {
- n_long h[RPC_HEADER_WORDS];
+ u_int32_t h[RPC_HEADER_WORDS];
struct nfs_read_args d;
} sdata;
struct {
- n_long h[RPC_HEADER_WORDS];
+ u_int32_t h[RPC_HEADER_WORDS];
struct nfs_read_repl d;
} rdata;
size_t cc;
repl = &rdata.d;
bcopy(d->fh, args->fh, NFS_FHSIZE);
- args->off = htonl((n_long)off);
+ args->off = htonl((u_int32_t)off);
if (len > NFSREAD_SIZE)
len = NFSREAD_SIZE;
- args->len = htonl((n_long)len);
- args->xxx = htonl((n_long)0);
+ args->len = htonl((u_int32_t)len);
+ args->xxx = htonl((u_int32_t)0);
hlen = sizeof(*repl) - NFSREAD_SIZE;
cc = rpc_call(d->iodesc, NFS_PROG, NFS_VER2, NFSPROC_READ,
nfs_seek(struct open_file *f, off_t offset, int where)
{
struct nfs_iodesc *d = (struct nfs_iodesc *)f->f_fsdata;
- n_long size = ntohl(d->fa.fa_size);
+ u_int32_t size = ntohl(d->fa.fa_size);
switch (where) {
case SEEK_SET:
nfs_stat(struct open_file *f, struct stat *sb)
{
struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata;
- n_long ftype, mode;
+ u_int32_t ftype, mode;
ftype = ntohl(fp->fa.fa_type);
mode = ntohl(fp->fa.fa_mode);
-/* $OpenBSD: nfsv2.h,v 1.5 2003/06/02 23:28:09 millert Exp $ */
+/* $OpenBSD: nfsv2.h,v 1.6 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: nfsv2.h,v 1.2 1996/02/26 23:05:23 gwr Exp $ */
/*
/* Structs for common parts of the rpc's */
struct nfsv2_time {
- n_long nfs_sec;
- n_long nfs_usec;
+ u_int32_t nfs_sec;
+ u_int32_t nfs_usec;
};
/*
* File attributes and setable attributes.
*/
struct nfsv2_fattr {
- n_long fa_type;
- n_long fa_mode;
- n_long fa_nlink;
- n_long fa_uid;
- n_long fa_gid;
- n_long fa_size;
- n_long fa_blocksize;
- n_long fa_rdev;
- n_long fa_blocks;
- n_long fa_fsid;
- n_long fa_fileid;
+ u_int32_t fa_type;
+ u_int32_t fa_mode;
+ u_int32_t fa_nlink;
+ u_int32_t fa_uid;
+ u_int32_t fa_gid;
+ u_int32_t fa_size;
+ u_int32_t fa_blocksize;
+ u_int32_t fa_rdev;
+ u_int32_t fa_blocks;
+ u_int32_t fa_fsid;
+ u_int32_t fa_fileid;
struct nfsv2_time fa_atime;
struct nfsv2_time fa_mtime;
struct nfsv2_time fa_ctime;
};
struct nfsv2_sattr {
- n_long sa_mode;
- n_long sa_uid;
- n_long sa_gid;
- n_long sa_size;
+ u_int32_t sa_mode;
+ u_int32_t sa_uid;
+ u_int32_t sa_gid;
+ u_int32_t sa_size;
struct nfsv2_time sa_atime;
struct nfsv2_time sa_mtime;
};
struct nfsv2_statfs {
- n_long sf_tsize;
- n_long sf_bsize;
- n_long sf_blocks;
- n_long sf_bfree;
- n_long sf_bavail;
+ u_int32_t sf_tsize;
+ u_int32_t sf_bsize;
+ u_int32_t sf_blocks;
+ u_int32_t sf_bfree;
+ u_int32_t sf_bavail;
};
-/* $OpenBSD: rarp.c,v 1.10 2003/08/11 06:23:09 deraadt Exp $ */
+/* $OpenBSD: rarp.c,v 1.11 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: rarp.c,v 1.13 1996/10/13 02:29:05 christos Exp $ */
/*
#include <netinet/in.h>
#include <netinet/if_ether.h>
-#include <netinet/in_systm.h>
#include "stand.h"
#include "net.h"
-/* $OpenBSD: rpc.c,v 1.13 2003/08/11 06:23:09 deraadt Exp $ */
+/* $OpenBSD: rpc.c,v 1.14 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: rpc.c,v 1.16 1996/10/13 02:29:06 christos Exp $ */
/*
#include <sys/socket.h>
#include <netinet/in.h>
-#include <netinet/in_systm.h>
#include <nfs/rpcv2.h>
/* Local forwards */
static ssize_t recvrpc(struct iodesc *, void *, size_t, time_t);
-static int rpc_getport(struct iodesc *, n_long, n_long);
+static int rpc_getport(struct iodesc *, u_int32_t, u_int32_t);
int rpc_xid;
int rpc_port = 0x400; /* predecrement */
* Note: Caller must leave room for headers.
*/
ssize_t
-rpc_call(struct iodesc *d, n_long prog, n_long vers, n_long proc, void *sdata,
+rpc_call(struct iodesc *d, u_int32_t prog, u_int32_t vers, u_int32_t proc, void *sdata,
size_t slen, void *rdata, size_t rlen)
{
ssize_t cc;
struct rpc_reply *reply;
char *send_head, *send_tail;
char *recv_head, *recv_tail;
- n_long x;
+ u_int32_t x;
int port; /* host order */
#ifdef RPC_DEBUG
{
struct hackhdr {
/* Tail of IP header: just IP addresses */
- n_long ip_src;
- n_long ip_dst;
+ u_int32_t ip_src;
+ u_int32_t ip_dst;
/* UDP header: */
u_int16_t uh_sport; /* source port */
u_int16_t uh_dport; /* destination port */
* Returns the port in host order.
*/
int
-rpc_getport(struct iodesc *d, n_long prog, n_long vers)
+rpc_getport(struct iodesc *d, u_int32_t prog, u_int32_t vers)
{
struct args {
- n_long prog; /* call program */
- n_long vers; /* call version */
- n_long proto; /* call protocol */
- n_long port; /* call port (unused) */
+ u_int32_t prog; /* call program */
+ u_int32_t vers; /* call version */
+ u_int32_t proto; /* call protocol */
+ u_int32_t port; /* call port (unused) */
} *args;
struct res {
- n_long port;
+ u_int32_t port;
} *res;
struct {
- n_long h[RPC_HEADER_WORDS];
+ u_int32_t h[RPC_HEADER_WORDS];
struct args d;
} sdata;
struct {
- n_long h[RPC_HEADER_WORDS];
+ u_int32_t h[RPC_HEADER_WORDS];
struct res d;
- n_long pad;
+ u_int32_t pad;
} rdata;
ssize_t cc;
int port;
-/* $OpenBSD: rpc.h,v 1.5 2003/08/11 06:23:09 deraadt Exp $ */
+/* $OpenBSD: rpc.h,v 1.6 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: rpc.h,v 1.8 1996/09/26 23:22:03 cgd Exp $ */
/*
#define PMAPPROC_CALLIT 5
/* RPC functions: */
-ssize_t rpc_call(struct iodesc *, n_long, n_long, n_long,
+ssize_t rpc_call(struct iodesc *, u_int32_t, u_int32_t, u_int32_t,
void *, size_t, void *, size_t);
void rpc_fromaddr(void *, struct in_addr *, u_short *);
int rpc_pmap_getcache(struct in_addr, u_int, u_int);
-/* $OpenBSD: tftp.c,v 1.5 2014/06/10 09:36:42 brad Exp $ */
+/* $OpenBSD: tftp.c,v 1.6 2014/07/13 15:31:20 mpi Exp $ */
/* $NetBSD: tftp.c,v 1.15 2003/08/18 15:45:29 dsl Exp $ */
/*
#include <sys/stat.h>
#include <netinet/in.h>
#include <netinet/udp.h>
-#include <netinet/in_systm.h>
#include <lib/libkern/libkern.h>
#include "stand.h"