mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-11-16 12:34:45 +00:00
2003-09-15 Jay Monkman <jtm@smothsmothie.com>
PR 481/networking * net/ethernet.h, net/if_arp.h, netinet/if_ether.h: Network structs should be packed
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2003-09-15 Jay Monkman <jtm@smothsmothie.com>
|
||||
|
||||
PR 481/networking
|
||||
* net/ethernet.h, net/if_arp.h, netinet/if_ether.h: Network structs
|
||||
should be packed
|
||||
|
||||
2003-09-15 Jay Monkman <jtm@smoothsmoothie.com>
|
||||
|
||||
PR 482/networking
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#ifndef _NET_ETHERNET_H_
|
||||
#define _NET_ETHERNET_H_
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
/*
|
||||
* The number of bytes in an ethernet (MAC) address.
|
||||
*/
|
||||
@@ -50,7 +52,7 @@
|
||||
struct ether_header {
|
||||
u_char ether_dhost[ETHER_ADDR_LEN];
|
||||
u_char ether_shost[ETHER_ADDR_LEN];
|
||||
u_short ether_type;
|
||||
u_short ether_type BYTE_PACK;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#ifndef _NET_IF_ARP_H_
|
||||
#define _NET_IF_ARP_H_
|
||||
|
||||
#include <netinet/in.h>
|
||||
/*
|
||||
* Address Resolution Protocol.
|
||||
*
|
||||
@@ -48,13 +49,13 @@
|
||||
* specified. Field names used correspond to RFC 826.
|
||||
*/
|
||||
struct arphdr {
|
||||
u_short ar_hrd; /* format of hardware address */
|
||||
u_short ar_hrd BYTE_PACK; /* format of hardware address */
|
||||
#define ARPHRD_ETHER 1 /* ethernet hardware format */
|
||||
#define ARPHRD_FRELAY 15 /* frame relay hardware format */
|
||||
u_short ar_pro; /* format of protocol address */
|
||||
u_char ar_hln; /* length of hardware address */
|
||||
u_char ar_pln; /* length of protocol address */
|
||||
u_short ar_op; /* one of: */
|
||||
u_short ar_pro BYTE_PACK; /* format of protocol address */
|
||||
u_char ar_hln BYTE_PACK; /* length of hardware address */
|
||||
u_char ar_pln BYTE_PACK; /* length of protocol address */
|
||||
u_short ar_op BYTE_PACK; /* one of: */
|
||||
#define ARPOP_REQUEST 1 /* request to resolve address */
|
||||
#define ARPOP_REPLY 2 /* response to previous request */
|
||||
#define ARPOP_REVREQUEST 3 /* request protocol address given hardware */
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#ifndef _NETINET_IF_ETHER_H_
|
||||
#define _NETINET_IF_ETHER_H_
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <net/ethernet.h>
|
||||
|
||||
#define ETHERTYPE_PUP 0x0200 /* PUP protocol */
|
||||
@@ -82,7 +83,7 @@
|
||||
* RFC 826.
|
||||
*/
|
||||
struct ether_arp {
|
||||
struct arphdr ea_hdr; /* fixed-size header */
|
||||
struct arphdr ea_hdr BYTE_PACK; /* fixed-size header */
|
||||
u_char arp_sha[ETHER_ADDR_LEN]; /* sender hardware address */
|
||||
u_char arp_spa[4]; /* sender protocol address */
|
||||
u_char arp_tha[ETHER_ADDR_LEN]; /* target hardware address */
|
||||
|
||||
Reference in New Issue
Block a user