/**
* @file
* Management Information Base II (RFC1213) objects and functions.
*
* @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.
*/
/*
* Copyright (c) 2006 Axon Digital Design B.V., The Netherlands.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* Author: Christiaan Simons <christiaan.simons@axon.tv>
*/
#include "lwip/opt.h"
#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
#include "lwip/snmp.h"
#include "lwip/netif.h"
#include "lwip/ip.h"
#include "lwip/ip_frag.h"
#include "lwip/mem.h"
#include "lwip/tcp_impl.h"
#include "lwip/udp.h"
#include "lwip/snmp_asn1.h"
#include "lwip/snmp_structs.h"
#include "lwip/sys.h"
#include "netif/etharp.h"
/**
* IANA assigned enterprise ID for lwIP is 26381
* @see http://www.iana.org/assignments/enterprise-numbers
*
* @note this enterprise ID is assigned to the lwIP project,
* all object identifiers living under this ID are assigned
* by the lwIP maintainers (contact Christiaan Simons)!
* @note don't change this define, use snmp_set_sysobjid()
*
* If you need to create your own private MIB you'll need
* to apply for your own enterprise ID with IANA:
* http://www.iana.org/numbers.html
*/
#define SNMP_ENTERPRISE_ID 26381
#define SNMP_SYSOBJID_LEN 7
#define SNMP_SYSOBJID {1, 3, 6, 1, 4, 1, SNMP_ENTERPRISE_ID}
#ifndef SNMP_SYSSERVICES
#define SNMP_SYSSERVICES ((1 << 6) | (1 << 3) | ((IP_FORWARD) << 2))
#endif
#ifndef SNMP_GET_SYSUPTIME
#define SNMP_GET_SYSUPTIME(sysuptime) (sysuptime = (sys_now() / 10))
#endif
static void system_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od);
static void system_get_value(struct obj_def *od, u16_t len, void *value);
static u8_t system_set_test(struct obj_def *od, u16_t len, void *value);
static void system_set_value(struct obj_def *od, u16_t len, void *value);
static void interfaces_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od);
static void interfaces_get_value(struct obj_def *od, u16_t len, void *value);
static void ifentry_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od);
static void ifentry_get_value(struct obj_def *od, u16_t len, void *value);
#if !SNMP_SAFE_REQUESTS
static u8_t ifentry_set_test (struct obj_def *od, u16_t len, void *value);
static void ifentry_set_value (struct obj_def *od, u16_t len, void *value);
#endif /* SNMP_SAFE_REQUESTS */
static void atentry_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od);
static void atentry_get_value(struct obj_def *od, u16_t len, void *value);
static void ip_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od);
static void ip_get_value(struct obj_def *od, u16_t len, void *value);
static u8_t ip_set_test(struct obj_def *od, u16_t len, void *value);
static void ip_addrentry_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od);
static void ip_addrentry_get_value(struct obj_def *od, u16_t len, void *value);
static void ip_rteentry_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od);
static void ip_rteentry_get_value(struct obj_def *od, u16_t len, void *value);
static void ip_ntomentry_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od);
static void ip_ntomentry_get_value(struct obj_def *od, u16_t len, void *value);
static void icmp_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od);
static void icmp_get_value(struct obj_def *od, u16_t len, void *value);
#if LWIP_TCP
static void tcp_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od);
static void tcp_get_value(struct obj_def *od, u16_t len, void *value);
#ifdef THIS_SEEMS_UNUSED
static void tcpconnentry_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od);
static void tcpconnentry_get_value(struct obj_def *od, u16_t len, void *value);
#endif
#endif
static void udp_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od);
static void udp_get_value(struct obj_def *od, u16_t len, void *value);
static void udpentry_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od);
static void udpentry_get_value(struct obj_def *od, u16_t len, void *value);
static void snmp_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od);
static void snmp_get_value(struct obj_def *od, u16_t len, void *value);
static u8_t snmp_set_test(struct obj_def *od, u16_t len, void *value);
static void snmp_set_value(struct obj_def *od, u16_t len, void *value);
/* snmp .1.3.6.1.2.1.11 */
const mib_scalar_node snmp_scalar = {
&snmp_get_object_def,
&snmp_get_value,
&snmp_set_test,
&snmp_set_value,
MIB_NODE_SC,
0
};
const s32_t snmp_ids[28] = {
1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30
};
struct mib_node* const snmp_nodes[28] = {
(struct mib_node*)&snmp_scalar, (struct mib_node*)&snmp_scalar,
(struct mib_node*)&snmp_scalar, (struct mib_node*)&snmp_scalar,
(struct mib_node*)&snmp_scalar, (struct mib_node*)&snmp_scalar,
(struct mib_node*)&snmp_scalar, (struct mib_node*)&snmp_scalar,
(struct mib_node*)&snmp_scalar, (struct mib_node*)&snmp_scalar,
(struct mib_node*)&snmp_scalar, (struct mib_node*)&snmp_scalar,
(struct mib_node*)&snmp_scalar, (struct mib_node*)&snmp_scalar,
(struct mib_node*)&snmp_scalar, (struct mib_node*)&snmp_scalar,
(struct mib_node*)&snmp_scalar, (struct mib_node*)&snmp_scalar,
(struct mib_node*)&snmp_scalar, (struct mib_node*)&snmp_scalar,
(struct mib_node*)&snmp_scalar, (struct mib_node*)&snmp_scalar,
(struct mib_node*)&snmp_scalar, (struct mib_node*)&snmp_scalar,
(struct mib_node*)&snmp_scalar, (struct mib_node*)&snmp_scalar,
(struct mib_node*)&snmp_scalar, (struct mib_node*)&snmp_scalar
};
const struct mib_array_node snmp = {
&noleafs_get_object_def,
&noleafs_get_value,
&noleafs_set_test,
&noleafs_set_value,
MIB_NODE_AR,
28,
snmp_ids,
snmp_nodes
};
/* dot3 and EtherLike MIB not planned. (transmission .1.3.6.1.2.1.10) */
/* historical (some say hysterical). (cmot .1.3.6.1.2.1.9) */
/* lwIP has no EGP, thus may not implement it. (egp .1.3.6.1.2.1.8) */
/* udp .1.3.6.1.2.1.7 */
/** index root node for udpTable */
struct mib_list_rootnode udp_root = {
&noleafs_get_object_def,
&noleafs_get_value,
&noleafs_set_test,
&noleafs_set_value,
MIB_NODE_LR,
0,
NULL,
NULL,
0
};
const s32_t udpentry_ids[2] = { 1, 2 };
struct mib_node* const udpentry_nodes[2] = {
(struct mib_node*)&udp_root, (struct mib_node*)&udp_root,
};
const struct mib_array_node udpentry = {
&noleafs_get_object_def,
&noleafs
没有合适的资源?快使用搜索试试~ 我知道了~
lwip.rar_LWIP RTX_RTX LWIP_at91sam7 rtx_lwip + rtx_rtx+lwip
共49个文件
c:47个
files:1个
readme:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 29 浏览量
2022-09-19
22:02:15
上传
评论
收藏 277KB RAR 举报
温馨提示
lwip at91sam7x256移植,基于 arm rtx操作系统内核
资源推荐
资源详情
资源评论
收起资源包目录
lwip.rar (49个子文件)
lwip
core
tcp.c 52KB
snmp
msg_out.c 21KB
mib2.c 103KB
mib_structs.c 29KB
msg_in.c 43KB
asn1_dec.c 16KB
asn1_enc.c 14KB
pbuf.c 38KB
raw.c 10KB
sys.c 2KB
dhcp.c 63KB
stats.c 6KB
dns.c 30KB
udp.c 33KB
def.c 3KB
netif.c 22KB
mem.c 23KB
ipv4
igmp.c 26KB
inet_chksum.c 13KB
inet.c 2KB
ip.c 32KB
ip_frag.c 28KB
autoip.c 18KB
ip_addr.c 8KB
icmp.c 11KB
ipv6
icmp6.c 6KB
inet6.c 4KB
README 43B
ip6_addr.c 3KB
ip6.c 11KB
tcp_in.c 59KB
init.c 14KB
memp.c 13KB
timers.c 13KB
tcp_out.c 49KB
netif
FILES 1KB
ethernetif.c 11KB
slipif.c 14KB
etharp.c 51KB
api
tcpip.c 14KB
netdb.c 11KB
err.c 3KB
netbuf.c 7KB
sockets.c 68KB
api_msg.c 45KB
netifapi.c 5KB
api_lib.c 23KB
port
EMAC.c 27KB
sys_arch.c 3KB
共 49 条
- 1
资源评论
邓凌佳
- 粉丝: 65
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功