| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- /*
- * arp data access header
- *
- * $Id$
- */
- #ifndef NETSNMP_ACCESS_ARP_H
- #define NETSNMP_ACCESS_ARP_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- /**---------------------------------------------------------------------*/
- #if defined( NETSNMP_ENABLE_IPV6 )
- # define NETSNMP_ACCESS_ARP_IPADDR_BUF_SIZE 16
- #else
- # define NETSNMP_ACCESS_ARP_IPADDR_BUF_SIZE 4
- #endif
- /** MAC address is 6, InfiniBand uses more, 32 must be enough for near future.*/
- #define NETSNMP_ACCESS_ARP_PHYSADDR_BUF_SIZE 32
- /*************************************************************
- * constants for enums for the MIB node
- * inetNetToMediaType (INTEGER / ASN_INTEGER)
- *
- * since a Textual Convention may be referenced more than once in a
- * MIB, protect againt redefinitions of the enum values.
- */
- #ifndef inetNetToMediaType_ENUMS
- #define inetNetToMediaType_ENUMS
- #define INETNETTOMEDIATYPE_OTHER 1
- #define INETNETTOMEDIATYPE_INVALID 2
- #define INETNETTOMEDIATYPE_DYNAMIC 3
- #define INETNETTOMEDIATYPE_STATIC 4
- #define INETNETTOMEDIATYPE_LOCAL 5
- #endif /* inetNetToMediaType_ENUMS */
- /*************************************************************
- * constants for enums for the MIB node
- * inetNetToMediaState (INTEGER / ASN_INTEGER)
- *
- * since a Textual Convention may be referenced more than once in a
- * MIB, protect againt redifinitions of the enum values.
- */
- #ifndef inetNetToMediaState_ENUMS
- #define inetNetToMediaState_ENUMS
- #define INETNETTOMEDIASTATE_REACHABLE 1
- #define INETNETTOMEDIASTATE_STALE 2
- #define INETNETTOMEDIASTATE_DELAY 3
- #define INETNETTOMEDIASTATE_PROBE 4
- #define INETNETTOMEDIASTATE_INVALID 5
- #define INETNETTOMEDIASTATE_UNKNOWN 6
- #define INETNETTOMEDIASTATE_INCOMPLETE 7
- #endif /* inetNetToMediaState_ENUMS */
- /**---------------------------------------------------------------------*/
- /*
- * structure definitions
- */
- /*
- * netsnmp_arp_entry
- * - primary arp structure for both ipv4 & ipv6
- */
- typedef struct netsnmp_arp_s {
- netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
- oid ns_arp_index; /* arbitrary index */
- int flags; /* for net-snmp use */
- unsigned generation;
- oid if_index;
- u_char arp_physaddress[NETSNMP_ACCESS_ARP_PHYSADDR_BUF_SIZE];
- u_char arp_ipaddress[NETSNMP_ACCESS_ARP_IPADDR_BUF_SIZE];
- u_char arp_physaddress_len;/* phys address len, max 32 */
- u_char arp_ipaddress_len; /* ip address len, 4 | 16 */
- u_char arp_type; /* inetNetToMediaType 1-5 */
- u_char arp_state; /* inetNetToMediaState 1-7 */
- u_long arp_last_updated; /* timeticks of last update */
- } netsnmp_arp_entry;
- #define NETSNMP_ACCESS_ARP_ENTRY_FLAG_DELETE 0x00000001
- /**---------------------------------------------------------------------*/
- /*
- * ACCESS function prototypes
- */
- struct netsnmp_arp_access_s;
- typedef struct netsnmp_arp_access_s netsnmp_arp_access;
- typedef void (NetsnmpAccessArpUpdate)(netsnmp_arp_access *, netsnmp_arp_entry*);
- typedef void (NetsnmpAccessArpGC) (netsnmp_arp_access *);
- struct netsnmp_arp_access_s {
- void *magic;
- void *arch_magic;
- int synchronized;
- unsigned generation;
- NetsnmpAccessArpUpdate *update_hook;
- NetsnmpAccessArpGC *gc_hook;
- char *cache_expired;
- };
- netsnmp_arp_access *
- netsnmp_access_arp_create(u_int init_flags,
- NetsnmpAccessArpUpdate *update_hook,
- NetsnmpAccessArpGC *gc_hook,
- int *cache_timeout, int *cache_flags,
- char *cache_expired);
- #define NETSNMP_ACCESS_ARP_CREATE_NOFLAGS 0x0000
- int netsnmp_access_arp_delete(netsnmp_arp_access *access);
- int netsnmp_access_arp_load(netsnmp_arp_access *access);
- int netsnmp_access_arp_unload(netsnmp_arp_access *access);
- /*
- * create/free a arp+entry
- */
- netsnmp_arp_entry *
- netsnmp_access_arp_entry_create(void);
- void netsnmp_access_arp_entry_free(netsnmp_arp_entry * entry);
- void netsnmp_access_arp_entry_update(netsnmp_arp_entry *entry,
- netsnmp_arp_entry *new_data);
- /*
- * find entry in container
- */
- /** not yet */
- /**---------------------------------------------------------------------*/
- #ifdef __cplusplus
- }
- #endif
- #endif /* NETSNMP_ACCESS_ARP_H */
|