00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __PANALIX_ARP_HPP
00012 #define __PANALIX_ARP_HPP
00013
00014 #include "src/net/net.hpp"
00015 #include "src/collection/option.hpp"
00016
00017 namespace Net {
00018 namespace Arp {
00019 struct arp_entry {
00020 struct netif *nif;
00021 struct ethernet_address eth_addr;
00022 struct ip_address ip_addr;
00023
00024 };
00025
00026 void init();
00027
00028 void processArpPacket(struct netbuf *nb);
00029
00030 struct Collection::Option<struct ethernet_address> arp_get_cached_ether(struct ip_address ip);
00031 struct Collection::Option<struct ethernet_address> arp_get_ether(struct ip_address ip);
00032
00033
00034
00035 #if 0
00036
00037 void arp_transmit_query(struct netif *nif, struct ip_address ip_addr) ;
00038 #endif
00039 #if 1
00040
00041 void arp_cache_insert(struct netif *nif, struct ip_address ip_addr, struct ethernet_address eth_addr) ;
00042 #endif
00043 }
00044 }
00045
00050 #if 0
00051 inline void print(struct Net::Arp::arp_entry arp) {
00052 prin("(arp-entry: nif=", (uint32)arp.nif, ", eth_addr=", arp.eth_addr, ", ip_addr=", arp.ip_addr,")");
00053 }
00054 #endif
00055
00058 #endif
00059