FreeBSD kernel IPv4 code
if_ether.h File Reference
#include <net/ethernet.h>
#include <net/if_arp.h>
Include dependency graph for if_ether.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ether_arp
 
struct  sockaddr_inarp
 

Macros

#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr)
 
#define ETHER_MAP_IPV6_MULTICAST(ip6addr, enaddr)
 
#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
 
#define SIN_PROXY   1
 
#define RTF_USETRAILERS   RTF_PROTO1 /* use trailers */
 
#define RTF_ANNOUNCE   RTF_PROTO2 /* announce new arp entry */
 

Functions

int arpresolve (struct ifnet *ifp, int is_gw, struct mbuf *m, const struct sockaddr *dst, u_char *desten, uint32_t *pflags, struct llentry **plle)
 
void arprequest (struct ifnet *, const struct in_addr *, const struct in_addr *, u_char *)
 
void arp_ifinit (struct ifnet *, struct ifaddr *)
 
void arp_announce_ifaddr (struct ifnet *, struct in_addr addr, u_char *)
 

Variables

u_char ether_ipmulticast_min [ETHER_ADDR_LEN]
 
u_char ether_ipmulticast_max [ETHER_ADDR_LEN]
 

Macro Definition Documentation

◆ arp_hln

#define arp_hln   ea_hdr.ar_hln

Definition at line 90 of file if_ether.h.

◆ arp_hrd

#define arp_hrd   ea_hdr.ar_hrd

Definition at line 88 of file if_ether.h.

◆ arp_op

#define arp_op   ea_hdr.ar_op

Definition at line 92 of file if_ether.h.

◆ arp_pln

#define arp_pln   ea_hdr.ar_pln

Definition at line 91 of file if_ether.h.

◆ arp_pro

#define arp_pro   ea_hdr.ar_pro

Definition at line 89 of file if_ether.h.

◆ ETHER_MAP_IP_MULTICAST

#define ETHER_MAP_IP_MULTICAST (   ipaddr,
  enaddr 
)
Value:
/* struct in_addr *ipaddr; */ \
/* u_char enaddr[ETHER_ADDR_LEN]; */ \
{ \
(enaddr)[0] = 0x01; \
(enaddr)[1] = 0x00; \
(enaddr)[2] = 0x5e; \
(enaddr)[3] = ((const u_char *)ipaddr)[1] & 0x7f; \
(enaddr)[4] = ((const u_char *)ipaddr)[2]; \
(enaddr)[5] = ((const u_char *)ipaddr)[3]; \
}

Definition at line 46 of file if_ether.h.

◆ ETHER_MAP_IPV6_MULTICAST

#define ETHER_MAP_IPV6_MULTICAST (   ip6addr,
  enaddr 
)
Value:
/* struct in6_addr *ip6addr; */ \
/* u_char enaddr[ETHER_ADDR_LEN]; */ \
{ \
(enaddr)[0] = 0x33; \
(enaddr)[1] = 0x33; \
(enaddr)[2] = ((const u_char *)ip6addr)[12]; \
(enaddr)[3] = ((const u_char *)ip6addr)[13]; \
(enaddr)[4] = ((const u_char *)ip6addr)[14]; \
(enaddr)[5] = ((const u_char *)ip6addr)[15]; \
}

Definition at line 62 of file if_ether.h.

◆ RTF_ANNOUNCE

#define RTF_ANNOUNCE   RTF_PROTO2 /* announce new arp entry */

Definition at line 111 of file if_ether.h.

◆ RTF_USETRAILERS

#define RTF_USETRAILERS   RTF_PROTO1 /* use trailers */

Definition at line 110 of file if_ether.h.

◆ SIN_PROXY

#define SIN_PROXY   1

Definition at line 103 of file if_ether.h.

Function Documentation

◆ arp_announce_ifaddr()

void arp_announce_ifaddr ( struct ifnet *  ifp,
struct in_addr  addr,
u_char *  enaddr 
)

Definition at line 1462 of file if_ether.c.

References arprequest(), INADDR_ANY, and in_addr::s_addr.

Referenced by arp_ifinit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ arp_ifinit()

void arp_ifinit ( struct ifnet *  ifp,
struct ifaddr *  ifa 
)

Definition at line 1437 of file if_ether.c.

References arp_add_ifa_lle(), arp_announce_ifaddr(), garp_rexmit_count, garp_timer_start(), INADDR_ANY, in_addr::s_addr, and sockaddr_in::sin_addr.

Referenced by arp_handle_ifllchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ arprequest()

void arprequest ( struct ifnet *  ifp,
const struct in_addr sip,
const struct in_addr tip,
u_char *  enaddr 
)

Definition at line 443 of file if_ether.c.

References arprequest_internal().

Referenced by arp_announce_ifaddr(), arptimer(), and garp_rexmit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ arpresolve()

int arpresolve ( struct ifnet *  ifp,
int  is_gw,
struct mbuf *  m,
const struct sockaddr *  dst,
u_char *  desten,
uint32_t pflags,
struct llentry **  plle 
)

Definition at line 614 of file if_ether.c.

References arpresolve_full(), ETHER_MAP_IP_MULTICAST, LLTABLE, and SIN.

Referenced by toe_l2_resolve().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ ether_ipmulticast_max

u_char ether_ipmulticast_max[ETHER_ADDR_LEN]
extern

◆ ether_ipmulticast_min

u_char ether_ipmulticast_min[ETHER_ADDR_LEN]
extern