Don't use private copy of old netinet/if_ether.h.

Use <net/if_ether.h> for ethernet specific definitions, and insert private
definitions for ARP if needed. (The new ARP macros in <net/if_arp.h> are
not used because they create larger code, and we really don't need more
than ethernet/ip support here.)
This commit is contained in:
drochner 1997-07-07 15:52:49 +00:00
parent d9e3ab6bcb
commit 64cd693ada
4 changed files with 49 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: arp.c,v 1.17 1997/06/26 19:11:30 drochner Exp $ */
/* $NetBSD: arp.c,v 1.18 1997/07/07 15:52:49 drochner Exp $ */
/*
* Copyright (c) 1992 Regents of the University of California.
@ -42,6 +42,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_ether.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
@ -52,10 +53,29 @@
#include <string.h>
#endif
#include "if_ether.h"
#include "stand.h"
#include "net.h"
/*
* Ethernet Address Resolution Protocol.
*
* See RFC 826 for protocol description. Structure below is adapted
* to resolving internet addresses. Field names used correspond to
* RFC 826.
*/
struct ether_arp {
struct arphdr ea_hdr; /* fixed-size header */
u_int8_t arp_sha[ETHER_ADDR_LEN]; /* sender hardware address */
u_int8_t arp_spa[4]; /* sender protocol address */
u_int8_t arp_tha[ETHER_ADDR_LEN]; /* target hardware address */
u_int8_t arp_tpa[4]; /* target protocol address */
};
#define arp_hrd ea_hdr.ar_hrd
#define arp_pro ea_hdr.ar_pro
#define arp_hln ea_hdr.ar_hln
#define arp_pln ea_hdr.ar_pln
#define arp_op ea_hdr.ar_op
/* Cache stuff */
#define ARP_NUM 8 /* need at most 3 arp entries */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ether.c,v 1.10 1997/06/26 19:11:36 drochner Exp $ */
/* $NetBSD: ether.c,v 1.11 1997/07/07 15:52:50 drochner Exp $ */
/*
* Copyright (c) 1992 Regents of the University of California.
@ -48,12 +48,12 @@
#endif
#include <net/if.h>
#include <net/if_ether.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include "if_ether.h"
#include "stand.h"
#include "net.h"
#include "netif.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: net.c,v 1.16 1997/06/26 19:11:42 drochner Exp $ */
/* $NetBSD: net.c,v 1.17 1997/07/07 15:52:51 drochner Exp $ */
/*
* Copyright (c) 1992 Regents of the University of California.
@ -49,6 +49,7 @@
#endif
#include <net/if.h>
#include <net/if_ether.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
@ -57,7 +58,6 @@
#include <netinet/udp.h>
#include <netinet/udp_var.h>
#include "if_ether.h"
#include "stand.h"
#include "net.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: rarp.c,v 1.15 1997/06/26 19:11:50 drochner Exp $ */
/* $NetBSD: rarp.c,v 1.16 1997/07/07 15:52:52 drochner Exp $ */
/*
* Copyright (c) 1992 Regents of the University of California.
@ -41,6 +41,7 @@
#include <sys/param.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_ether.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
@ -51,11 +52,31 @@
#include <string.h>
#endif
#include "if_ether.h"
#include "stand.h"
#include "net.h"
#include "netif.h"
/*
* Ethernet Address Resolution Protocol.
*
* See RFC 826 for protocol description. Structure below is adapted
* to resolving internet addresses. Field names used correspond to
* RFC 826.
*/
struct ether_arp {
struct arphdr ea_hdr; /* fixed-size header */
u_int8_t arp_sha[ETHER_ADDR_LEN]; /* sender hardware address */
u_int8_t arp_spa[4]; /* sender protocol address */
u_int8_t arp_tha[ETHER_ADDR_LEN]; /* target hardware address */
u_int8_t arp_tpa[4]; /* target protocol address */
};
#define arp_hrd ea_hdr.ar_hrd
#define arp_pro ea_hdr.ar_pro
#define arp_hln ea_hdr.ar_hln
#define arp_pln ea_hdr.ar_pln
#define arp_op ea_hdr.ar_op
static ssize_t rarpsend __P((struct iodesc *, void *, size_t));
static ssize_t rarprecv __P((struct iodesc *, void *, size_t, time_t));