1,5 → 1,5 |
/* |
* Copyright (c) 2008 Lukas Mejdrech |
* Copyright (c) 2009 Lukas Mejdrech |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
31,6 → 31,7 |
*/ |
|
/** @file |
* ARP module. |
*/ |
|
#ifndef __NET_ARP_H__ |
44,46 → 45,122 |
#include "../../structures/int_map.h" |
#include "../../structures/measured_strings.h" |
|
|
/** Type definition of the ARP global data. |
* @see arp_globals |
*/ |
typedef struct arp_globals arp_globals_t; |
typedef arp_globals_t * arp_globals_ref; |
|
/** Type definition of the ARP device specific data. |
* @see arp_device |
*/ |
typedef struct arp_device arp_device_t; |
|
/** Type definition of the ARP device specific data pointer. |
* @see arp_device |
*/ |
typedef arp_device_t * arp_device_ref; |
|
/** Type definition of the ARP protocol specific data. |
* @see arp_proto |
*/ |
typedef struct arp_proto arp_proto_t; |
|
/** Type definition of the ARP protocol specific data pointer. |
* @see arp_proto |
*/ |
typedef arp_proto_t * arp_proto_ref; |
|
/** ARP address cache. |
* Maps devices to the ARP device specific data. |
* @see device.h |
*/ |
DEVICE_MAP_DECLARE( arp_cache, arp_device_t ) |
|
/** ARP protocol map. |
* Maps protocol identifiers to the ARP protocol specific data. |
* @see int_map.h |
*/ |
INT_MAP_DECLARE( arp_protos, arp_proto_t ) |
|
/** ARP address map. |
* Translates addresses. |
* @see generic_char_map.h |
*/ |
GENERIC_CHAR_MAP_DECLARE( arp_addr, measured_string_t ) |
|
/** ARP device specific data. |
*/ |
struct arp_device{ |
/** Device identifier. |
*/ |
device_id_t device_id; |
/** Hardware type. |
*/ |
ipcarg_t hardware; |
ipcarg_t protocol; |
/** Reserved packet prefix length. |
*/ |
ipcarg_t prefix; |
/** Maximal packet content length. |
*/ |
ipcarg_t content; |
ipcarg_t sufix; |
/** Reserved packet suffix length. |
*/ |
ipcarg_t suffix; |
/** Packet address length. |
* The hardware address length is used. |
*/ |
ipcarg_t addr_len; |
/** Actual device hardware address. |
*/ |
measured_string_ref addr; |
/** Actual device hardware address data. |
*/ |
char * addr_data; |
/** Broadcast device hardware address. |
*/ |
measured_string_ref broadcast_addr; |
/** Broadcast device hardware address data. |
*/ |
char * broadcast_data; |
/** Device driver service. |
*/ |
services_t service; |
/** Driver phone. |
*/ |
int phone; |
/** Protocol map. |
* Address map for each protocol. |
*/ |
arp_protos_t protos; |
}; |
|
/** ARP protocol specific data. |
*/ |
struct arp_proto{ |
/** Protocol service. |
*/ |
services_t service; |
// int phone; |
/** Actual device protocol address. |
*/ |
measured_string_ref addr; |
/** Actual device protocol address data. |
*/ |
char * addr_data; |
/** Address map. |
*/ |
arp_addr_t addresses; |
}; |
|
/** ARP global data. |
*/ |
struct arp_globals{ |
/** Networking module phone. |
*/ |
int networking_phone; |
/** ARP address cache. |
*/ |
arp_cache_t cache; |
}; |
|