#include <ubixos/types.h>
#include <lib/kprintf.h>
#include "net/debug.h"
#include "net/ipv4/inet.h"
#include "netif/arp.h"
#include "net/ipv4/ip.h"
Go to the source code of this file.
Data Structures | |
| struct | arp_entry |
| struct | arp_hdr |
| struct | ethip_hdr |
Defines | |
| #define | ARP_MAXAGE 2 |
| #define | ARP_REPLY 2 |
| #define | ARP_REQUEST 1 |
| #define | ARPH_HWLEN(hdr) (NTOHS((hdr)->_hwlen_protolen) >> 8) |
| #define | ARPH_HWLEN_SET(hdr, len) (hdr)->_hwlen_protolen = HTONS(ARPH_PROTOLEN(hdr) | ((len) << 8)) |
| #define | ARPH_PROTOLEN(hdr) (NTOHS((hdr)->_hwlen_protolen) & 0xff) |
| #define | ARPH_PROTOLEN_SET(hdr, len) (hdr)->_hwlen_protolen = HTONS((len) | (ARPH_HWLEN(hdr) << 8)) |
| #define | HWTYPE_ETHERNET 1 |
Functions | |
| static void | add_arp_entry (struct ip_addr *ipaddr, struct eth_addr *ethaddr) |
| pbuf * | arp_arp_input (struct netif *netif, struct eth_addr *ethaddr, struct pbuf *p) |
| void | arp_init (void) |
| void | arp_ip_input (struct netif *netif, struct pbuf *p) |
| eth_addr * | arp_lookup (struct ip_addr *ipaddr) |
| pbuf * | arp_query (struct netif *netif, struct eth_addr *ethaddr, struct ip_addr *ipaddr) |
| void | arp_tmr (void) |
Variables | |
| static struct arp_entry | arp_table [ARP_TABLE_SIZE] |
| static uInt8 | ctime |
| PACK_STRUCT_BEGIN struct arp_hdr | PACK_STRUCT_STRUCT |
| #define ARP_REPLY 2 |
| #define ARP_REQUEST 1 |
| #define ARPH_HWLEN | ( | hdr | ) | (NTOHS((hdr)->_hwlen_protolen) >> 8) |
| #define ARPH_HWLEN_SET | ( | hdr, | |||
| len | ) | (hdr)->_hwlen_protolen = HTONS(ARPH_PROTOLEN(hdr) | ((len) << 8)) |
| #define ARPH_PROTOLEN | ( | hdr | ) | (NTOHS((hdr)->_hwlen_protolen) & 0xff) |
| #define ARPH_PROTOLEN_SET | ( | hdr, | |||
| len | ) | (hdr)->_hwlen_protolen = HTONS((len) | (ARPH_HWLEN(hdr) << 8)) |
| #define HWTYPE_ETHERNET 1 |
Definition at line 120 of file arp.c.
References arp_table, ARP_TABLE_SIZE, ctime, arp_entry::ctime, arp_entry::ethaddr, ip_addr_cmp, ip_addr_isany, ip_addr_set, and arp_entry::ipaddr.
Referenced by arp_arp_input(), and arp_ip_input().
Definition at line 197 of file arp.c.
References add_arp_entry(), ARP_REPLY, ARP_REQUEST, ARPH_HWLEN_SET, ARPH_PROTOLEN_SET, ETHTYPE_ARP, ETHTYPE_IP, htons, HWTYPE_ETHERNET, netif::ip_addr, ip_addr_cmp, ip_addr_set, kprintf(), NULL, pbuf::payload, pbuf_free(), and pbuf::tot_len.
Referenced by ethernetif_input().
| void arp_init | ( | void | ) |
Definition at line 93 of file arp.c.
References arp_table, ARP_TABLE_SIZE, IP_ADDR_ANY, ip_addr_set, and arp_entry::ipaddr.
Referenced by ethernetif_init().
Definition at line 181 of file arp.c.
References add_arp_entry(), ARP_DEBUG, DEBUGF, netif::ip_addr, ip_addr_maskcmp, netif::netmask, and pbuf::payload.
Referenced by ethernetif_input().
Definition at line 253 of file arp.c.
References arp_table, ARP_TABLE_SIZE, ip_addr_cmp, and NULL.
Referenced by ethernetif_output().
Definition at line 266 of file arp.c.
References ARP_REQUEST, ARPH_HWLEN_SET, ARPH_PROTOLEN_SET, ETHTYPE_ARP, ETHTYPE_IP, htons, HWTYPE_ETHERNET, netif::ip_addr, ip_addr_set, NULL, pbuf::payload, pbuf_alloc(), PBUF_LINK, and PBUF_RAM.
Referenced by ethernetif_output().
| void arp_tmr | ( | void | ) |
Definition at line 104 of file arp.c.
References ARP_DEBUG, ARP_MAXAGE, arp_table, ARP_TABLE_SIZE, ctime, DEBUGF, IP_ADDR_ANY, ip_addr_isany, ip_addr_set, and arp_entry::ipaddr.
Referenced by arp_timer().
Definition at line 88 of file arp.c.
Referenced by add_arp_entry(), arp_init(), arp_lookup(), and arp_tmr().
| PACK_STRUCT_BEGIN struct arp_hdr PACK_STRUCT_STRUCT |
1.4.7