mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-02-10 12:39:55 +00:00
Removed EXPERIMENTAL status.
This commit is contained in:
parent
f6f6f11838
commit
bc182cab7c
@ -1,19 +1,23 @@
|
|||||||
SNMPv1 agent for lwIP [preliminairy]
|
SNMPv1 agent for lwIP
|
||||||
|
|
||||||
Author: Christiaan Simons
|
Author: Christiaan Simons
|
||||||
|
|
||||||
This is a brief introduction how to use and configure the SNMP agent.
|
This is a brief introduction how to use and configure the SNMP agent.
|
||||||
Note the agent uses the raw-API UDP interface so you may also want to
|
Note the agent uses the raw-API UDP interface so you may also want to
|
||||||
read rawapi.txt to gain a better understanding of the SNMP messages handling.
|
read rawapi.txt to gain a better understanding of the SNMP message handling.
|
||||||
|
|
||||||
0 Agent capabilities
|
0 Agent Capabilities
|
||||||
====================
|
====================
|
||||||
|
|
||||||
SNMPv1 per RFC1157
|
SNMPv1 per RFC1157
|
||||||
This is an old(er) standard but is still widely supported.
|
This is an old(er) standard but is still widely supported.
|
||||||
For SNMPv2c and v3 have a greater complexity and need many
|
For SNMPv2c and v3 have a greater complexity and need many
|
||||||
more lines of code. IMHO this breaks the idea of "lightweight IP".
|
more lines of code. IMHO this breaks the idea of "lightweight IP".
|
||||||
Note the S in SNMP stands for "Simple" and is actually a bad joke.
|
|
||||||
|
Note the S in SNMP stands for "Simple". Note that "Simple" is
|
||||||
|
relative. SNMP is simple compared to the complex ISO network
|
||||||
|
management protocols CMIP (Common Management Information Protocol)
|
||||||
|
and CMOT (CMip Over Tcp).
|
||||||
|
|
||||||
MIB II per RFC1213
|
MIB II per RFC1213
|
||||||
The standard lwIP stack management information base.
|
The standard lwIP stack management information base.
|
||||||
@ -47,7 +51,7 @@ Large SNMP message support
|
|||||||
PBUF_POOL_SIZE and IP_REASS_BUFSIZE are set to match your
|
PBUF_POOL_SIZE and IP_REASS_BUFSIZE are set to match your
|
||||||
local requirement.
|
local requirement.
|
||||||
|
|
||||||
1 Building the agent
|
1 Building the Agent
|
||||||
====================
|
====================
|
||||||
|
|
||||||
First of all you'll need to add the following define
|
First of all you'll need to add the following define
|
||||||
@ -61,7 +65,7 @@ and some snmp headers in lwip/src/include/lwip to your makefile.
|
|||||||
Note you'll might need to adapt you network driver to update
|
Note you'll might need to adapt you network driver to update
|
||||||
the mib2 variables for your interface.
|
the mib2 variables for your interface.
|
||||||
|
|
||||||
2 Running the agent
|
2 Running the Agent
|
||||||
===================
|
===================
|
||||||
|
|
||||||
The following function calls must be made in your program to
|
The following function calls must be made in your program to
|
||||||
@ -121,11 +125,14 @@ Note the object identifiers for thes MIB-2 and your private MIB
|
|||||||
tree must be kept in sorted ascending (lexicographical) order.
|
tree must be kept in sorted ascending (lexicographical) order.
|
||||||
This to ensure correct getnext operation.
|
This to ensure correct getnext operation.
|
||||||
|
|
||||||
|
An example for a private MIB is part of the "minimal Unix" project:
|
||||||
|
contrib/ports/unix/proj/minimal/lwip_prvmib.c
|
||||||
|
|
||||||
The next chapter gives a more detailed description of the
|
The next chapter gives a more detailed description of the
|
||||||
MIB-2 tree and the optional private MIB.
|
MIB-2 tree and the optional private MIB.
|
||||||
|
|
||||||
4 Agent internals
|
4 The Gory Details
|
||||||
=================
|
==================
|
||||||
|
|
||||||
4.0 Object identifiers and the MIB tree.
|
4.0 Object identifiers and the MIB tree.
|
||||||
|
|
||||||
@ -161,3 +168,5 @@ The index part is handled by functions which in
|
|||||||
turn use dynamically allocated index trees from RAM.
|
turn use dynamically allocated index trees from RAM.
|
||||||
These trees are updated by e.g. the etharp code
|
These trees are updated by e.g. the etharp code
|
||||||
when new entries are made or removed form the ARP cache.
|
when new entries are made or removed form the ARP cache.
|
||||||
|
|
||||||
|
/** @todo more gory details */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* [EXPERIMENTAL] Abstract Syntax Notation One (ISO 8824, 8825) encoding
|
* Abstract Syntax Notation One (ISO 8824, 8825) encoding
|
||||||
*
|
*
|
||||||
* @todo not optimised (yet), favor correctness over speed, favor speed over size
|
* @todo not optimised (yet), favor correctness over speed, favor speed over size
|
||||||
*/
|
*/
|
||||||
@ -207,9 +207,6 @@ snmp_asn1_enc_type(struct pbuf *p, u16_t ofs, u8_t type)
|
|||||||
* @param ofs points to the offset within the pbuf chain
|
* @param ofs points to the offset within the pbuf chain
|
||||||
* @param length is the host order length to be encoded
|
* @param length is the host order length to be encoded
|
||||||
* @return ERR_OK if successfull, ERR_ARG if we can't (or won't) encode
|
* @return ERR_OK if successfull, ERR_ARG if we can't (or won't) encode
|
||||||
*
|
|
||||||
* @todo also add octets_used instead of compares??
|
|
||||||
* @todo encode "type" in this function as well??
|
|
||||||
*/
|
*/
|
||||||
err_t
|
err_t
|
||||||
snmp_asn1_enc_length(struct pbuf *p, u16_t ofs, u16_t length)
|
snmp_asn1_enc_length(struct pbuf *p, u16_t ofs, u16_t length)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* [EXPERIMENTAL] Management Information Base II (RFC1213) objects and functions.
|
* Management Information Base II (RFC1213) objects and functions.
|
||||||
*
|
*
|
||||||
* @note the object identifiers for this MIB-2 and private MIB tree
|
* @note the object identifiers for this MIB-2 and private MIB tree
|
||||||
* must be kept in sorted ascending order. This to ensure correct getnext operation.
|
* must be kept in sorted ascending order. This to ensure correct getnext operation.
|
||||||
@ -2586,10 +2586,6 @@ atentry_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @todo the etharp_find_addr could be a lot smarter
|
|
||||||
* if our arp index tree provided pointers or index to the requested item
|
|
||||||
*/
|
|
||||||
static void
|
static void
|
||||||
atentry_get_value(struct obj_def *od, u16_t len, void *value)
|
atentry_get_value(struct obj_def *od, u16_t len, void *value)
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* [EXPERIMENTAL] MIB tree access/construction functions.
|
* MIB tree access/construction functions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* [EXPERIMENTAL] SNMP input message processing (RFC1157).
|
* SNMP input message processing (RFC1157).
|
||||||
*
|
|
||||||
* EXPERIMENTAL code, this is not how the agent should respond.
|
|
||||||
* This is for test purposes only, DO NOT USE THIS CODE IN REAL WORLD!!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* [EXPERIMENTAL] SNMP output message processing (RFC1157).
|
* SNMP output message processing (RFC1157).
|
||||||
*
|
*
|
||||||
* Output responses and traps are build in two passes:
|
* Output responses and traps are build in two passes:
|
||||||
*
|
*
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* [EXPERIMENTAL] Abstract Syntax Notation One (ISO 8824, 8825) codec.
|
* Abstract Syntax Notation One (ISO 8824, 8825) codec.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* [EXPERIMENTAL] SNMP Agent message handling structures.
|
* SNMP Agent message handling structures.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -203,9 +203,6 @@ struct snmp_trap_header_lengths
|
|||||||
#define SNMP_COMMUNITY_STR_LEN 64
|
#define SNMP_COMMUNITY_STR_LEN 64
|
||||||
struct snmp_msg_pstat
|
struct snmp_msg_pstat
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
struct snmp_msg_pstat *next;
|
|
||||||
#endif
|
|
||||||
/* lwIP local port (161) binding */
|
/* lwIP local port (161) binding */
|
||||||
struct udp_pcb *pcb;
|
struct udp_pcb *pcb;
|
||||||
/* source IP address */
|
/* source IP address */
|
||||||
@ -241,17 +238,10 @@ struct snmp_msg_pstat
|
|||||||
struct snmp_varbind_root outvb;
|
struct snmp_varbind_root outvb;
|
||||||
/* output response lengths used in ASN encoding */
|
/* output response lengths used in ASN encoding */
|
||||||
struct snmp_resp_header_lengths rhl;
|
struct snmp_resp_header_lengths rhl;
|
||||||
#if SNMP_PRIVATE_MIB
|
|
||||||
/* private MIB event info */
|
|
||||||
struct private_msg pm;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct snmp_msg_trap
|
struct snmp_msg_trap
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
struct snmp_msg_trap *next;
|
|
||||||
#endif
|
|
||||||
/* lwIP local port (161) binding */
|
/* lwIP local port (161) binding */
|
||||||
struct udp_pcb *pcb;
|
struct udp_pcb *pcb;
|
||||||
/* destination IP address in network order */
|
/* destination IP address in network order */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* [EXPERIMENTAL] Generic MIB tree structures.
|
* Generic MIB tree structures.
|
||||||
*
|
*
|
||||||
* @todo namespace prefixes
|
* @todo namespace prefixes
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user