mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 13:34:38 +08:00
minor: whitespace cleanups
This commit is contained in:
parent
9725a496b5
commit
14fb48cd7a
@ -1086,7 +1086,7 @@ lwip_sendmsg(int s, const struct msghdr *msg, int flags)
|
|||||||
} else {
|
} else {
|
||||||
pbuf_cat(chain_buf->p, p);
|
pbuf_cat(chain_buf->p, p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* save size of total chain */
|
/* save size of total chain */
|
||||||
if (err == ERR_OK) {
|
if (err == ERR_OK) {
|
||||||
size = netbuf_len(chain_buf);
|
size = netbuf_len(chain_buf);
|
||||||
|
@ -375,7 +375,7 @@ tcpip_api_call(tcpip_api_call_fn fn, struct tcpip_api_call_data *call)
|
|||||||
#endif /* LWIP_NETCONN_SEM_PER_THREAD */
|
#endif /* LWIP_NETCONN_SEM_PER_THREAD */
|
||||||
|
|
||||||
LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox));
|
LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox));
|
||||||
|
|
||||||
TCPIP_MSG_VAR_ALLOC(msg);
|
TCPIP_MSG_VAR_ALLOC(msg);
|
||||||
TCPIP_MSG_VAR_REF(msg).type = TCPIP_MSG_API_CALL;
|
TCPIP_MSG_VAR_REF(msg).type = TCPIP_MSG_API_CALL;
|
||||||
TCPIP_MSG_VAR_REF(msg).msg.api_call.arg = call;
|
TCPIP_MSG_VAR_REF(msg).msg.api_call.arg = call;
|
||||||
|
@ -353,7 +353,7 @@ strnstr(const char* buffer, const char* token, size_t n)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif /* LWIP_HTTPD_STRNSTR_PRIVATE */
|
#endif /* LWIP_HTTPD_STRNSTR_PRIVATE */
|
||||||
|
|
||||||
#if LWIP_HTTPD_STRICMP_PRIVATE
|
#if LWIP_HTTPD_STRICMP_PRIVATE
|
||||||
@ -1112,7 +1112,7 @@ http_send_headers(struct tcp_pcb *pcb, struct http_state *hs)
|
|||||||
* (which would happen when sending files from async read). */
|
* (which would happen when sending files from async read). */
|
||||||
if(http_check_eof(pcb, hs)) {
|
if(http_check_eof(pcb, hs)) {
|
||||||
data_to_send = HTTP_DATA_TO_SEND_CONTINUE;
|
data_to_send = HTTP_DATA_TO_SEND_CONTINUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* If we get here and there are still header bytes to send, we send
|
/* If we get here and there are still header bytes to send, we send
|
||||||
* the header information we just wrote immediately. If there are no
|
* the header information we just wrote immediately. If there are no
|
||||||
@ -2584,7 +2584,7 @@ http_accept(void *arg, struct tcp_pcb *pcb, err_t err)
|
|||||||
LWIP_UNUSED_ARG(err);
|
LWIP_UNUSED_ARG(err);
|
||||||
LWIP_UNUSED_ARG(arg);
|
LWIP_UNUSED_ARG(arg);
|
||||||
LWIP_DEBUGF(HTTPD_DEBUG, ("http_accept %p / %p\n", (void*)pcb, arg));
|
LWIP_DEBUGF(HTTPD_DEBUG, ("http_accept %p / %p\n", (void*)pcb, arg));
|
||||||
|
|
||||||
if ((err != ERR_OK) || (pcb == NULL)) {
|
if ((err != ERR_OK) || (pcb == NULL)) {
|
||||||
return ERR_VAL;
|
return ERR_VAL;
|
||||||
}
|
}
|
||||||
@ -2684,7 +2684,7 @@ http_set_cgi_handlers(const tCGI *cgis, int num_handlers)
|
|||||||
{
|
{
|
||||||
LWIP_ASSERT("no cgis given", cgis != NULL);
|
LWIP_ASSERT("no cgis given", cgis != NULL);
|
||||||
LWIP_ASSERT("invalid number of handlers", num_handlers > 0);
|
LWIP_ASSERT("invalid number of handlers", num_handlers > 0);
|
||||||
|
|
||||||
g_pCGIs = cgis;
|
g_pCGIs = cgis;
|
||||||
g_iNumCGIs = num_handlers;
|
g_iNumCGIs = num_handlers;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* makefsdata: Converts a directory structure for use with the lwIP httpd.
|
* makefsdata: Converts a directory structure for use with the lwIP httpd.
|
||||||
*
|
*
|
||||||
* This file is part of the lwIP TCP/IP stack.
|
* This file is part of the lwIP TCP/IP stack.
|
||||||
*
|
*
|
||||||
* Author: Jim Pettinato
|
* Author: Jim Pettinato
|
||||||
* Simon Goldschmidt
|
* Simon Goldschmidt
|
||||||
*
|
*
|
||||||
@ -818,7 +818,7 @@ int file_write_http_header(FILE *data_file, const char *filename, int file_size,
|
|||||||
u8_t provide_last_modified = includeLastModified;
|
u8_t provide_last_modified = includeLastModified;
|
||||||
|
|
||||||
memset(hdr_buf, 0, sizeof(hdr_buf));
|
memset(hdr_buf, 0, sizeof(hdr_buf));
|
||||||
|
|
||||||
if (useHttp11) {
|
if (useHttp11) {
|
||||||
response_type = HTTP_HDR_OK_11;
|
response_type = HTTP_HDR_OK_11;
|
||||||
}
|
}
|
||||||
|
@ -1778,7 +1778,7 @@ mdns_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr,
|
|||||||
struct mdns_packet packet;
|
struct mdns_packet packet;
|
||||||
struct netif *recv_netif = ip_current_input_netif();
|
struct netif *recv_netif = ip_current_input_netif();
|
||||||
u16_t offset = 0;
|
u16_t offset = 0;
|
||||||
|
|
||||||
LWIP_UNUSED_ARG(arg);
|
LWIP_UNUSED_ARG(arg);
|
||||||
LWIP_UNUSED_ARG(pcb);
|
LWIP_UNUSED_ARG(pcb);
|
||||||
|
|
||||||
|
@ -196,10 +196,10 @@ snmp_asn1_enc_u64t(struct snmp_pbuf_stream* pbuf_stream, u16_t octets_needed, co
|
|||||||
octets_needed--;
|
octets_needed--;
|
||||||
PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, (u8_t)(*value >> ((octets_needed-4) << 3))));
|
PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, (u8_t)(*value >> ((octets_needed-4) << 3))));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* skip to low u32 */
|
/* skip to low u32 */
|
||||||
value++;
|
value++;
|
||||||
|
|
||||||
while (octets_needed > 1) {
|
while (octets_needed > 1) {
|
||||||
octets_needed--;
|
octets_needed--;
|
||||||
PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, (u8_t)(*value >> (octets_needed << 3))));
|
PBUF_OP_EXEC(snmp_pbuf_stream_write(pbuf_stream, (u8_t)(*value >> (octets_needed << 3))));
|
||||||
@ -367,7 +367,7 @@ snmp_asn1_enc_s32t_cnt(s32_t value, u16_t *octets_needed)
|
|||||||
{
|
{
|
||||||
if (value < 0) {
|
if (value < 0) {
|
||||||
value = ~value;
|
value = ~value;
|
||||||
}
|
}
|
||||||
if (value < 0x80L) {
|
if (value < 0x80L) {
|
||||||
*octets_needed = 1;
|
*octets_needed = 1;
|
||||||
} else if (value < 0x8000L) {
|
} else if (value < 0x8000L) {
|
||||||
@ -453,7 +453,7 @@ snmp_asn1_dec_tlv(struct snmp_pbuf_stream* pbuf_stream, struct snmp_asn1_tlv* tl
|
|||||||
PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data));
|
PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data));
|
||||||
tlv->value_len <<= 8;
|
tlv->value_len <<= 8;
|
||||||
tlv->value_len |= data;
|
tlv->value_len |= data;
|
||||||
|
|
||||||
/* take care for special value used for indefinite length */
|
/* take care for special value used for indefinite length */
|
||||||
if (tlv->value_len == 0xFFFF) {
|
if (tlv->value_len == 0xFFFF) {
|
||||||
return ERR_VAL;
|
return ERR_VAL;
|
||||||
@ -551,7 +551,7 @@ snmp_asn1_dec_u64t(struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t *value
|
|||||||
} else {
|
} else {
|
||||||
*value <<= 8;
|
*value <<= 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
*value |= data;
|
*value |= data;
|
||||||
len--;
|
len--;
|
||||||
}
|
}
|
||||||
@ -588,7 +588,7 @@ snmp_asn1_dec_s32t(struct snmp_pbuf_stream *pbuf_stream, u16_t len, s32_t *value
|
|||||||
if ((len > 0) && (len < 5)) {
|
if ((len > 0) && (len < 5)) {
|
||||||
PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data));
|
PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data));
|
||||||
len--;
|
len--;
|
||||||
|
|
||||||
if (data & 0x80) {
|
if (data & 0x80) {
|
||||||
/* negative, start from -1 */
|
/* negative, start from -1 */
|
||||||
*value = -1;
|
*value = -1;
|
||||||
@ -649,7 +649,7 @@ snmp_asn1_dec_oid(struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t* oid, u
|
|||||||
if (oid_max_len < 2) {
|
if (oid_max_len < 2) {
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data));
|
PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, &data));
|
||||||
len--;
|
len--;
|
||||||
|
|
||||||
@ -736,7 +736,7 @@ snmp_asn1_dec_raw(struct snmp_pbuf_stream *pbuf_stream, u16_t len, u8_t *buf, u1
|
|||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
*buf_len = len;
|
*buf_len = len;
|
||||||
|
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, buf));
|
PBUF_OP_EXEC(snmp_pbuf_stream_read(pbuf_stream, buf));
|
||||||
buf++;
|
buf++;
|
||||||
|
@ -322,10 +322,10 @@ snmp_oid_to_ip6(const u32_t *oid, ip6_addr_t *ip)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ip->addr[0] = (oid[0] << 24) | (oid[1] << 16) | (oid[2] << 8) | (oid[3] << 0);
|
ip->addr[0] = (oid[0] << 24) | (oid[1] << 16) | (oid[2] << 8) | (oid[3] << 0);
|
||||||
ip->addr[1] = (oid[4] << 24) | (oid[5] << 16) | (oid[6] << 8) | (oid[7] << 0);
|
ip->addr[1] = (oid[4] << 24) | (oid[5] << 16) | (oid[6] << 8) | (oid[7] << 0);
|
||||||
ip->addr[2] = (oid[8] << 24) | (oid[9] << 16) | (oid[10] << 8) | (oid[11] << 0);
|
ip->addr[2] = (oid[8] << 24) | (oid[9] << 16) | (oid[10] << 8) | (oid[11] << 0);
|
||||||
ip->addr[3] = (oid[12] << 24) | (oid[13] << 16) | (oid[14] << 8) | (oid[15] << 0);
|
ip->addr[3] = (oid[12] << 24) | (oid[13] << 16) | (oid[14] << 8) | (oid[15] << 0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -372,7 +372,7 @@ snmp_ip_port_to_oid(const ip_addr_t *ip, u16_t port, u32_t *oid)
|
|||||||
idx = snmp_ip_to_oid(ip, oid);
|
idx = snmp_ip_to_oid(ip, oid);
|
||||||
oid[idx] = port;
|
oid[idx] = port;
|
||||||
idx++;
|
idx++;
|
||||||
|
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -424,7 +424,7 @@ snmp_oid_to_ip(const u32_t *oid, u8_t oid_len, ip_addr_t *ip)
|
|||||||
if (oid_len < 1) {
|
if (oid_len < 1) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oid[0] == 0) { /* any */
|
if (oid[0] == 0) { /* any */
|
||||||
/* 1x InetAddressType, 1x OID len */
|
/* 1x InetAddressType, 1x OID len */
|
||||||
if (oid_len < 2) {
|
if (oid_len < 2) {
|
||||||
@ -454,7 +454,7 @@ snmp_oid_to_ip(const u32_t *oid, u8_t oid_len, ip_addr_t *ip)
|
|||||||
if (!snmp_oid_to_ip4(&oid[2], ip_2_ip4(ip))) {
|
if (!snmp_oid_to_ip4(&oid[2], ip_2_ip4(ip))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 6;
|
return 6;
|
||||||
#else /* LWIP_IPV4 */
|
#else /* LWIP_IPV4 */
|
||||||
return 0;
|
return 0;
|
||||||
@ -497,7 +497,7 @@ u8_t
|
|||||||
snmp_oid_to_ip_port(const u32_t *oid, u8_t oid_len, ip_addr_t *ip, u16_t *port)
|
snmp_oid_to_ip_port(const u32_t *oid, u8_t oid_len, ip_addr_t *ip, u16_t *port)
|
||||||
{
|
{
|
||||||
u8_t idx = 0;
|
u8_t idx = 0;
|
||||||
|
|
||||||
/* InetAddressType + InetAddress */
|
/* InetAddressType + InetAddress */
|
||||||
idx += snmp_oid_to_ip(&oid[idx], oid_len-idx, ip);
|
idx += snmp_oid_to_ip(&oid[idx], oid_len-idx, ip);
|
||||||
if (idx == 0) {
|
if (idx == 0) {
|
||||||
@ -581,7 +581,7 @@ snmp_oid_combine(struct snmp_obj_id* target, const u32_t *oid1, u8_t oid1_len, c
|
|||||||
* @param oid
|
* @param oid
|
||||||
* @param oid_len
|
* @param oid_len
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
snmp_oid_append(struct snmp_obj_id* target, const u32_t *oid, u8_t oid_len)
|
snmp_oid_append(struct snmp_obj_id* target, const u32_t *oid, u8_t oid_len)
|
||||||
{
|
{
|
||||||
LWIP_ASSERT("offset + oid_len <= LWIP_SNMP_OBJ_ID_LEN", (target->len + oid_len) <= SNMP_MAX_OBJ_ID_LEN);
|
LWIP_ASSERT("offset + oid_len <= LWIP_SNMP_OBJ_ID_LEN", (target->len + oid_len) <= SNMP_MAX_OBJ_ID_LEN);
|
||||||
@ -629,7 +629,7 @@ snmp_oid_compare(const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* they are equal */
|
/* they are equal */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -772,7 +772,7 @@ snmp_get_node_instance_from_oid(const u32_t *oid, u8_t oid_len, struct snmp_node
|
|||||||
mib = snmp_get_mib_from_oid(oid, oid_len);
|
mib = snmp_get_mib_from_oid(oid, oid_len);
|
||||||
if (mib != NULL) {
|
if (mib != NULL) {
|
||||||
u8_t oid_instance_len;
|
u8_t oid_instance_len;
|
||||||
|
|
||||||
mn = snmp_mib_tree_resolve_exact(mib, oid, oid_len, &oid_instance_len);
|
mn = snmp_mib_tree_resolve_exact(mib, oid, oid_len, &oid_instance_len);
|
||||||
if ((mn != NULL) && (mn->node_type != SNMP_NODE_TREE)) {
|
if ((mn != NULL) && (mn->node_type != SNMP_NODE_TREE)) {
|
||||||
/* get instance */
|
/* get instance */
|
||||||
@ -802,7 +802,7 @@ snmp_get_node_instance_from_oid(const u32_t *oid, u8_t oid_len, struct snmp_node
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8_t
|
u8_t
|
||||||
snmp_get_next_node_instance_from_oid(const u32_t *oid, u8_t oid_len, snmp_validate_node_instance_method validate_node_instance_method, void* validate_node_instance_arg, struct snmp_obj_id* node_oid, struct snmp_node_instance* node_instance)
|
snmp_get_next_node_instance_from_oid(const u32_t *oid, u8_t oid_len, snmp_validate_node_instance_method validate_node_instance_method, void* validate_node_instance_arg, struct snmp_obj_id* node_oid, struct snmp_node_instance* node_instance)
|
||||||
{
|
{
|
||||||
const struct snmp_mib *mib;
|
const struct snmp_mib *mib;
|
||||||
@ -828,7 +828,7 @@ snmp_get_next_node_instance_from_oid(const u32_t *oid, u8_t oid_len, snmp_valida
|
|||||||
/* resolve target node from MIB, skip to next MIB if no suitable node is found in current MIB */
|
/* resolve target node from MIB, skip to next MIB if no suitable node is found in current MIB */
|
||||||
while ((mib != NULL) && (mn == NULL)) {
|
while ((mib != NULL) && (mn == NULL)) {
|
||||||
u8_t oid_instance_len;
|
u8_t oid_instance_len;
|
||||||
|
|
||||||
/* check if OID directly references a node inside current MIB, in this case we have to ask this node for the next instance */
|
/* check if OID directly references a node inside current MIB, in this case we have to ask this node for the next instance */
|
||||||
mn = snmp_mib_tree_resolve_exact(mib, start_oid, start_oid_len, &oid_instance_len);
|
mn = snmp_mib_tree_resolve_exact(mib, start_oid, start_oid_len, &oid_instance_len);
|
||||||
if (mn != NULL) {
|
if (mn != NULL) {
|
||||||
@ -881,9 +881,9 @@ snmp_get_next_node_instance_from_oid(const u32_t *oid, u8_t oid_len, snmp_valida
|
|||||||
if (node_instance->release_instance != NULL) {
|
if (node_instance->release_instance != NULL) {
|
||||||
node_instance->release_instance(node_instance);
|
node_instance->release_instance(node_instance);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
the instance itself is not valid, ask for next instance from same node.
|
the instance itself is not valid, ask for next instance from same node.
|
||||||
we don't have to change any variables because node_instance->instance_oid is used as input (starting point)
|
we don't have to change any variables because node_instance->instance_oid is used as input (starting point)
|
||||||
as well as output (resulting next OID), so we have to simply call get_next_instance method again
|
as well as output (resulting next OID), so we have to simply call get_next_instance method again
|
||||||
*/
|
*/
|
||||||
} else {
|
} else {
|
||||||
@ -926,7 +926,7 @@ snmp_get_next_node_instance_from_oid(const u32_t *oid, u8_t oid_len, snmp_valida
|
|||||||
}
|
}
|
||||||
/* else { we found out target node } */
|
/* else { we found out target node } */
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
there is no further (suitable) node inside this MIB, search for the next MIB with following priority
|
there is no further (suitable) node inside this MIB, search for the next MIB with following priority
|
||||||
1. search for inner MIB's (whose root is located inside tree of current MIB)
|
1. search for inner MIB's (whose root is located inside tree of current MIB)
|
||||||
2. search for surrouding MIB's (where the current MIB is the inner MIB) and continue there if any
|
2. search for surrouding MIB's (where the current MIB is the inner MIB) and continue there if any
|
||||||
@ -1004,11 +1004,11 @@ snmp_mib_tree_resolve_exact(const struct snmp_mib *mib, const u32_t *oid, u8_t o
|
|||||||
*oid_instance_len = oid_len - oid_offset;
|
*oid_instance_len = oid_len - oid_offset;
|
||||||
return (*node);
|
return (*node);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct snmp_node*
|
const struct snmp_node*
|
||||||
snmp_mib_tree_resolve_next(const struct snmp_mib *mib, const u32_t *oid, u8_t oid_len, struct snmp_obj_id* oidret)
|
snmp_mib_tree_resolve_next(const struct snmp_mib *mib, const u32_t *oid, u8_t oid_len, struct snmp_obj_id* oidret)
|
||||||
{
|
{
|
||||||
u8_t oid_offset = mib->base_oid_len;
|
u8_t oid_offset = mib->base_oid_len;
|
||||||
@ -1099,7 +1099,7 @@ snmp_mib_tree_resolve_next(const struct snmp_mib *mib, const u32_t *oid, u8_t oi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1140,7 +1140,7 @@ snmp_next_oid_precheck(struct snmp_next_oid_state *state, const u32_t *oid, cons
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** checks the passed OID if it is a candidate to be the next one (get_next); returns !=0 if passed oid is currently closest, otherwise 0 */
|
/** checks the passed OID if it is a candidate to be the next one (get_next); returns !=0 if passed oid is currently closest, otherwise 0 */
|
||||||
u8_t
|
u8_t
|
||||||
snmp_next_oid_check(struct snmp_next_oid_state *state, const u32_t *oid, const u8_t oid_len, void* reference)
|
snmp_next_oid_check(struct snmp_next_oid_state *state, const u32_t *oid, const u8_t oid_len, void* reference)
|
||||||
{
|
{
|
||||||
/* do not overwrite a fail result */
|
/* do not overwrite a fail result */
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
/* --- interfaces .1.3.6.1.2.1.2 ----------------------------------------------------- */
|
/* --- interfaces .1.3.6.1.2.1.2 ----------------------------------------------------- */
|
||||||
|
|
||||||
static s16_t
|
static s16_t
|
||||||
interfaces_get_value(struct snmp_node_instance* instance, void* value)
|
interfaces_get_value(struct snmp_node_instance* instance, void* value)
|
||||||
{
|
{
|
||||||
if (instance->node->oid == 1) {
|
if (instance->node->oid == 1) {
|
||||||
@ -131,7 +131,7 @@ interfaces_Table_get_next_cell_instance(const u32_t* column, struct snmp_obj_id*
|
|||||||
u32_t result_temp[LWIP_ARRAYSIZE(interfaces_Table_oid_ranges)];
|
u32_t result_temp[LWIP_ARRAYSIZE(interfaces_Table_oid_ranges)];
|
||||||
|
|
||||||
LWIP_UNUSED_ARG(column);
|
LWIP_UNUSED_ARG(column);
|
||||||
|
|
||||||
/* init struct to search next oid */
|
/* init struct to search next oid */
|
||||||
snmp_next_oid_init(&state, row_oid->id, row_oid->len, result_temp, LWIP_ARRAYSIZE(interfaces_Table_oid_ranges));
|
snmp_next_oid_init(&state, row_oid->id, row_oid->len, result_temp, LWIP_ARRAYSIZE(interfaces_Table_oid_ranges));
|
||||||
|
|
||||||
@ -289,11 +289,10 @@ interfaces_Table_set_test(struct snmp_node_instance* instance, u16_t len, void *
|
|||||||
LWIP_ASSERT("Invalid column", (SNMP_TABLE_GET_COLUMN_FROM_OID(instance->instance_oid.id) == 7));
|
LWIP_ASSERT("Invalid column", (SNMP_TABLE_GET_COLUMN_FROM_OID(instance->instance_oid.id) == 7));
|
||||||
LWIP_UNUSED_ARG(len);
|
LWIP_UNUSED_ARG(len);
|
||||||
|
|
||||||
if (*sint_ptr == 1 || *sint_ptr == 2)
|
if (*sint_ptr == 1 || *sint_ptr == 2) {
|
||||||
{
|
|
||||||
return SNMP_ERR_NOERROR;
|
return SNMP_ERR_NOERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
return SNMP_ERR_WRONGVALUE;
|
return SNMP_ERR_WRONGVALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,17 +351,17 @@ static const struct snmp_table_col_def interfaces_Table_columns[] = {
|
|||||||
|
|
||||||
#if !SNMP_SAFE_REQUESTS
|
#if !SNMP_SAFE_REQUESTS
|
||||||
static const struct snmp_table_node interfaces_Table = SNMP_TABLE_CREATE(
|
static const struct snmp_table_node interfaces_Table = SNMP_TABLE_CREATE(
|
||||||
2, interfaces_Table_columns,
|
2, interfaces_Table_columns,
|
||||||
interfaces_Table_get_cell_instance, interfaces_Table_get_next_cell_instance,
|
interfaces_Table_get_cell_instance, interfaces_Table_get_next_cell_instance,
|
||||||
interfaces_Table_get_value, interfaces_Table_set_test, interfaces_Table_set_value);
|
interfaces_Table_get_value, interfaces_Table_set_test, interfaces_Table_set_value);
|
||||||
#else
|
#else
|
||||||
static const struct snmp_table_node interfaces_Table = SNMP_TABLE_CREATE(
|
static const struct snmp_table_node interfaces_Table = SNMP_TABLE_CREATE(
|
||||||
2, interfaces_Table_columns,
|
2, interfaces_Table_columns,
|
||||||
interfaces_Table_get_cell_instance, interfaces_Table_get_next_cell_instance,
|
interfaces_Table_get_cell_instance, interfaces_Table_get_next_cell_instance,
|
||||||
interfaces_Table_get_value, NULL, NULL);
|
interfaces_Table_get_value, NULL, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* the following nodes access variables in LWIP stack from SNMP worker thread and must therefore be synced to LWIP (TCPIP) thread */
|
/* the following nodes access variables in LWIP stack from SNMP worker thread and must therefore be synced to LWIP (TCPIP) thread */
|
||||||
CREATE_LWIP_SYNC_NODE(1, interfaces_Number)
|
CREATE_LWIP_SYNC_NODE(1, interfaces_Number)
|
||||||
CREATE_LWIP_SYNC_NODE(2, interfaces_Table)
|
CREATE_LWIP_SYNC_NODE(2, interfaces_Table)
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
#if LWIP_IPV4
|
#if LWIP_IPV4
|
||||||
/* --- ip .1.3.6.1.2.1.4 ----------------------------------------------------- */
|
/* --- ip .1.3.6.1.2.1.4 ----------------------------------------------------- */
|
||||||
|
|
||||||
static s16_t
|
static s16_t
|
||||||
ip_get_value(struct snmp_node_instance* instance, void* value)
|
ip_get_value(struct snmp_node_instance* instance, void* value)
|
||||||
{
|
{
|
||||||
s32_t* sint_ptr = (s32_t*)value;
|
s32_t* sint_ptr = (s32_t*)value;
|
||||||
@ -304,7 +304,7 @@ ip_AddrTable_get_next_cell_instance_and_value(const u32_t* column, struct snmp_o
|
|||||||
/* fill in object properties */
|
/* fill in object properties */
|
||||||
return ip_AddrTable_get_cell_value_core((struct netif*)state.reference, column, value, value_len);
|
return ip_AddrTable_get_cell_value_core((struct netif*)state.reference, column, value, value_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* not found */
|
/* not found */
|
||||||
return SNMP_ERR_NOSUCHINSTANCE;
|
return SNMP_ERR_NOSUCHINSTANCE;
|
||||||
}
|
}
|
||||||
@ -464,7 +464,7 @@ ip_RouteTable_get_next_cell_instance_and_value(const u32_t* column, struct snmp_
|
|||||||
snmp_ip4_to_oid(&dst, &test_oid[0]);
|
snmp_ip4_to_oid(&dst, &test_oid[0]);
|
||||||
snmp_next_oid_check(&state, test_oid, LWIP_ARRAYSIZE(ip_RouteTable_oid_ranges), netif);
|
snmp_next_oid_check(&state, test_oid, LWIP_ARRAYSIZE(ip_RouteTable_oid_ranges), netif);
|
||||||
}
|
}
|
||||||
|
|
||||||
netif = netif->next;
|
netif = netif->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -660,7 +660,7 @@ static const struct snmp_table_simple_node ip_NetToMediaTable = SNMP_TABLE_CREAT
|
|||||||
#endif /* LWIP_ARP && LWIP_IPV4 */
|
#endif /* LWIP_ARP && LWIP_IPV4 */
|
||||||
|
|
||||||
#if LWIP_IPV4
|
#if LWIP_IPV4
|
||||||
/* the following nodes access variables in LWIP stack from SNMP worker thread and must therefore be synced to LWIP (TCPIP) thread */
|
/* the following nodes access variables in LWIP stack from SNMP worker thread and must therefore be synced to LWIP (TCPIP) thread */
|
||||||
CREATE_LWIP_SYNC_NODE( 1, ip_Forwarding)
|
CREATE_LWIP_SYNC_NODE( 1, ip_Forwarding)
|
||||||
CREATE_LWIP_SYNC_NODE( 2, ip_DefaultTTL)
|
CREATE_LWIP_SYNC_NODE( 2, ip_DefaultTTL)
|
||||||
CREATE_LWIP_SYNC_NODE( 3, ip_InReceives)
|
CREATE_LWIP_SYNC_NODE( 3, ip_InReceives)
|
||||||
@ -730,7 +730,7 @@ static const struct snmp_table_simple_col_def at_Table_columns[] = {
|
|||||||
|
|
||||||
static const struct snmp_table_simple_node at_Table = SNMP_TABLE_CREATE_SIMPLE(1, at_Table_columns, ip_NetToMediaTable_get_cell_value, ip_NetToMediaTable_get_next_cell_instance_and_value);
|
static const struct snmp_table_simple_node at_Table = SNMP_TABLE_CREATE_SIMPLE(1, at_Table_columns, ip_NetToMediaTable_get_cell_value, ip_NetToMediaTable_get_next_cell_instance_and_value);
|
||||||
|
|
||||||
/* the following nodes access variables in LWIP stack from SNMP worker thread and must therefore be synced to LWIP (TCPIP) thread */
|
/* the following nodes access variables in LWIP stack from SNMP worker thread and must therefore be synced to LWIP (TCPIP) thread */
|
||||||
CREATE_LWIP_SYNC_NODE(1, at_Table)
|
CREATE_LWIP_SYNC_NODE(1, at_Table)
|
||||||
|
|
||||||
static const struct snmp_node* const at_nodes[] = {
|
static const struct snmp_node* const at_nodes[] = {
|
||||||
|
@ -188,7 +188,7 @@ snmp_set_value(const struct snmp_scalar_array_node_def *node, u16_t len, void *v
|
|||||||
return SNMP_ERR_NOERROR;
|
return SNMP_ERR_NOERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the following nodes access variables in SNMP stack (snmp_stats) from SNMP worker thread -> OK, no sync needed */
|
/* the following nodes access variables in SNMP stack (snmp_stats) from SNMP worker thread -> OK, no sync needed */
|
||||||
static const struct snmp_scalar_array_node_def snmp_nodes[] = {
|
static const struct snmp_scalar_array_node_def snmp_nodes[] = {
|
||||||
{ 1, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInPkts */
|
{ 1, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpInPkts */
|
||||||
{ 2, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpOutPkts */
|
{ 2, SNMP_ASN1_TYPE_COUNTER, SNMP_NODE_INSTANCE_READ_ONLY}, /* snmpOutPkts */
|
||||||
|
@ -106,7 +106,7 @@ snmp_mib2_set_sysdescr(const u8_t *str, const u16_t *len)
|
|||||||
* Initializes sysContact pointers
|
* Initializes sysContact pointers
|
||||||
*
|
*
|
||||||
* @param ocstr if non-NULL then copy str pointer
|
* @param ocstr if non-NULL then copy str pointer
|
||||||
* @param ocstrlen points to string length, excluding zero terminator.
|
* @param ocstrlen points to string length, excluding zero terminator.
|
||||||
* if set to NULL it is assumed that ocstr is NULL-terminated.
|
* if set to NULL it is assumed that ocstr is NULL-terminated.
|
||||||
* @param bufsize size of the buffer in bytes.
|
* @param bufsize size of the buffer in bytes.
|
||||||
* (this is required because the buffer can be overwritten by snmp-set)
|
* (this is required because the buffer can be overwritten by snmp-set)
|
||||||
@ -148,7 +148,7 @@ snmp_mib2_set_syscontact_readonly(const u8_t *ocstr, const u16_t *ocstrlen)
|
|||||||
* Initializes sysName pointers
|
* Initializes sysName pointers
|
||||||
*
|
*
|
||||||
* @param ocstr if non-NULL then copy str pointer
|
* @param ocstr if non-NULL then copy str pointer
|
||||||
* @param ocstrlen points to string length, excluding zero terminator.
|
* @param ocstrlen points to string length, excluding zero terminator.
|
||||||
* if set to NULL it is assumed that ocstr is NULL-terminated.
|
* if set to NULL it is assumed that ocstr is NULL-terminated.
|
||||||
* @param bufsize size of the buffer in bytes.
|
* @param bufsize size of the buffer in bytes.
|
||||||
* (this is required because the buffer can be overwritten by snmp-set)
|
* (this is required because the buffer can be overwritten by snmp-set)
|
||||||
@ -189,7 +189,7 @@ snmp_mib2_set_sysname_readonly(const u8_t *ocstr, const u16_t *ocstrlen)
|
|||||||
* Initializes sysLocation pointers
|
* Initializes sysLocation pointers
|
||||||
*
|
*
|
||||||
* @param ocstr if non-NULL then copy str pointer
|
* @param ocstr if non-NULL then copy str pointer
|
||||||
* @param ocstrlen points to string length, excluding zero terminator.
|
* @param ocstrlen points to string length, excluding zero terminator.
|
||||||
* if set to NULL it is assumed that ocstr is NULL-terminated.
|
* if set to NULL it is assumed that ocstr is NULL-terminated.
|
||||||
* @param bufsize size of the buffer in bytes.
|
* @param bufsize size of the buffer in bytes.
|
||||||
* (this is required because the buffer can be overwritten by snmp-set)
|
* (this is required because the buffer can be overwritten by snmp-set)
|
||||||
@ -278,7 +278,7 @@ system_get_value(const struct snmp_scalar_array_node_def *node, void *value)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static snmp_err_t
|
static snmp_err_t
|
||||||
system_set_test(const struct snmp_scalar_array_node_def *node, u16_t len, void *value)
|
system_set_test(const struct snmp_scalar_array_node_def *node, u16_t len, void *value)
|
||||||
{
|
{
|
||||||
snmp_err_t ret = SNMP_ERR_WRONGVALUE;
|
snmp_err_t ret = SNMP_ERR_WRONGVALUE;
|
||||||
@ -324,7 +324,7 @@ system_set_test(const struct snmp_scalar_array_node_def *node, u16_t len, void *
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static snmp_err_t
|
static snmp_err_t
|
||||||
system_set_value(const struct snmp_scalar_array_node_def *node, u16_t len, void *value)
|
system_set_value(const struct snmp_scalar_array_node_def *node, u16_t len, void *value)
|
||||||
{
|
{
|
||||||
u8_t* var_wr = NULL;
|
u8_t* var_wr = NULL;
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
/* --- tcp .1.3.6.1.2.1.6 ----------------------------------------------------- */
|
/* --- tcp .1.3.6.1.2.1.6 ----------------------------------------------------- */
|
||||||
|
|
||||||
static s16_t
|
static s16_t
|
||||||
tcp_get_value(struct snmp_node_instance* instance, void* value)
|
tcp_get_value(struct snmp_node_instance* instance, void* value)
|
||||||
{
|
{
|
||||||
u32_t *uint_ptr = (u32_t*)value;
|
u32_t *uint_ptr = (u32_t*)value;
|
||||||
@ -154,7 +154,7 @@ static const struct snmp_oid_range tcp_ConnTable_oid_ranges[] = {
|
|||||||
{ 0, 0xffff } /* Port */
|
{ 0, 0xffff } /* Port */
|
||||||
};
|
};
|
||||||
|
|
||||||
static snmp_err_t
|
static snmp_err_t
|
||||||
tcp_ConnTable_get_cell_value_core(struct tcp_pcb *pcb, const u32_t* column, union snmp_variant_value* value, u32_t* value_len)
|
tcp_ConnTable_get_cell_value_core(struct tcp_pcb *pcb, const u32_t* column, union snmp_variant_value* value, u32_t* value_len)
|
||||||
{
|
{
|
||||||
LWIP_UNUSED_ARG(value_len);
|
LWIP_UNUSED_ARG(value_len);
|
||||||
@ -212,7 +212,7 @@ tcp_ConnTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t row
|
|||||||
local_port = (u16_t)row_oid[4];
|
local_port = (u16_t)row_oid[4];
|
||||||
snmp_oid_to_ip4(&row_oid[5], &remote_ip); /* we know it succeeds because of oid_in_range check above */
|
snmp_oid_to_ip4(&row_oid[5], &remote_ip); /* we know it succeeds because of oid_in_range check above */
|
||||||
remote_port = (u16_t)row_oid[9];
|
remote_port = (u16_t)row_oid[9];
|
||||||
|
|
||||||
/* find tcp_pcb with requested ips and ports */
|
/* find tcp_pcb with requested ips and ports */
|
||||||
for (i = 0; i < LWIP_ARRAYSIZE(tcp_pcb_lists); i++) {
|
for (i = 0; i < LWIP_ARRAYSIZE(tcp_pcb_lists); i++) {
|
||||||
pcb = *tcp_pcb_lists[i];
|
pcb = *tcp_pcb_lists[i];
|
||||||
@ -261,7 +261,7 @@ tcp_ConnTable_get_next_cell_instance_and_value(const u32_t* column, struct snmp_
|
|||||||
pcb = *tcp_pcb_lists[i];
|
pcb = *tcp_pcb_lists[i];
|
||||||
while (pcb != NULL) {
|
while (pcb != NULL) {
|
||||||
u32_t test_oid[LWIP_ARRAYSIZE(tcp_ConnTable_oid_ranges)];
|
u32_t test_oid[LWIP_ARRAYSIZE(tcp_ConnTable_oid_ranges)];
|
||||||
|
|
||||||
if (IP_IS_V4_VAL(pcb->local_ip)) {
|
if (IP_IS_V4_VAL(pcb->local_ip)) {
|
||||||
snmp_ip4_to_oid(ip_2_ip4(&pcb->local_ip), &test_oid[0]);
|
snmp_ip4_to_oid(ip_2_ip4(&pcb->local_ip), &test_oid[0]);
|
||||||
test_oid[4] = pcb->local_port;
|
test_oid[4] = pcb->local_port;
|
||||||
@ -281,7 +281,7 @@ tcp_ConnTable_get_next_cell_instance_and_value(const u32_t* column, struct snmp_
|
|||||||
/* check generated OID: is it a candidate for the next one? */
|
/* check generated OID: is it a candidate for the next one? */
|
||||||
snmp_next_oid_check(&state, test_oid, LWIP_ARRAYSIZE(tcp_ConnTable_oid_ranges), pcb);
|
snmp_next_oid_check(&state, test_oid, LWIP_ARRAYSIZE(tcp_ConnTable_oid_ranges), pcb);
|
||||||
}
|
}
|
||||||
|
|
||||||
pcb = pcb->next;
|
pcb = pcb->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -301,10 +301,10 @@ tcp_ConnTable_get_next_cell_instance_and_value(const u32_t* column, struct snmp_
|
|||||||
|
|
||||||
/* --- tcpConnectionTable --- */
|
/* --- tcpConnectionTable --- */
|
||||||
|
|
||||||
static snmp_err_t
|
static snmp_err_t
|
||||||
tcp_ConnectionTable_get_cell_value_core(const u32_t* column, struct tcp_pcb *pcb, union snmp_variant_value* value)
|
tcp_ConnectionTable_get_cell_value_core(const u32_t* column, struct tcp_pcb *pcb, union snmp_variant_value* value)
|
||||||
{
|
{
|
||||||
/* all items except tcpConnectionState and tcpConnectionProcess are declared as not-accessible */
|
/* all items except tcpConnectionState and tcpConnectionProcess are declared as not-accessible */
|
||||||
switch (*column) {
|
switch (*column) {
|
||||||
case 7: /* tcpConnectionState */
|
case 7: /* tcpConnectionState */
|
||||||
value->u32 = pcb->state + 1;
|
value->u32 = pcb->state + 1;
|
||||||
@ -336,7 +336,7 @@ tcp_ConnectionTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8
|
|||||||
if (idx == 0) {
|
if (idx == 0) {
|
||||||
return SNMP_ERR_NOSUCHINSTANCE;
|
return SNMP_ERR_NOSUCHINSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tcpConnectionRemAddressType + tcpConnectionRemAddress + tcpConnectionRemPort */
|
/* tcpConnectionRemAddressType + tcpConnectionRemAddress + tcpConnectionRemPort */
|
||||||
idx += snmp_oid_to_ip_port(&row_oid[idx], row_oid_len-idx, &remote_ip, &remote_port);
|
idx += snmp_oid_to_ip_port(&row_oid[idx], row_oid_len-idx, &remote_ip, &remote_port);
|
||||||
if (idx == 0) {
|
if (idx == 0) {
|
||||||
@ -346,7 +346,7 @@ tcp_ConnectionTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8
|
|||||||
/* find tcp_pcb with requested ip and port*/
|
/* find tcp_pcb with requested ip and port*/
|
||||||
for (i = 0; i < LWIP_ARRAYSIZE(tcp_pcb_nonlisten_lists); i++) {
|
for (i = 0; i < LWIP_ARRAYSIZE(tcp_pcb_nonlisten_lists); i++) {
|
||||||
pcb = *tcp_pcb_nonlisten_lists[i];
|
pcb = *tcp_pcb_nonlisten_lists[i];
|
||||||
|
|
||||||
while (pcb != NULL) {
|
while (pcb != NULL) {
|
||||||
if (ip_addr_cmp(&local_ip, &pcb->local_ip) &&
|
if (ip_addr_cmp(&local_ip, &pcb->local_ip) &&
|
||||||
(local_port == pcb->local_port) &&
|
(local_port == pcb->local_port) &&
|
||||||
@ -358,9 +358,9 @@ tcp_ConnectionTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8
|
|||||||
pcb = pcb->next;
|
pcb = pcb->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* not found */
|
/* not found */
|
||||||
return SNMP_ERR_NOSUCHINSTANCE;
|
return SNMP_ERR_NOSUCHINSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static snmp_err_t
|
static snmp_err_t
|
||||||
@ -395,11 +395,11 @@ tcp_ConnectionTable_get_next_cell_instance_and_value(const u32_t* column, struct
|
|||||||
|
|
||||||
/* check generated OID: is it a candidate for the next one? */
|
/* check generated OID: is it a candidate for the next one? */
|
||||||
snmp_next_oid_check(&state, test_oid, idx, pcb);
|
snmp_next_oid_check(&state, test_oid, idx, pcb);
|
||||||
|
|
||||||
pcb = pcb->next;
|
pcb = pcb->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* did we find a next one? */
|
/* did we find a next one? */
|
||||||
if (state.status == SNMP_NEXT_OID_STATUS_SUCCESS) {
|
if (state.status == SNMP_NEXT_OID_STATUS_SUCCESS) {
|
||||||
snmp_oid_assign(row_oid, state.next_oid, state.next_oid_len);
|
snmp_oid_assign(row_oid, state.next_oid, state.next_oid_len);
|
||||||
@ -413,10 +413,10 @@ tcp_ConnectionTable_get_next_cell_instance_and_value(const u32_t* column, struct
|
|||||||
|
|
||||||
/* --- tcpListenerTable --- */
|
/* --- tcpListenerTable --- */
|
||||||
|
|
||||||
static snmp_err_t
|
static snmp_err_t
|
||||||
tcp_ListenerTable_get_cell_value_core(const u32_t* column, union snmp_variant_value* value)
|
tcp_ListenerTable_get_cell_value_core(const u32_t* column, union snmp_variant_value* value)
|
||||||
{
|
{
|
||||||
/* all items except tcpListenerProcess are declared as not-accessible */
|
/* all items except tcpListenerProcess are declared as not-accessible */
|
||||||
switch (*column) {
|
switch (*column) {
|
||||||
case 4: /* tcpListenerProcess */
|
case 4: /* tcpListenerProcess */
|
||||||
value->u32 = 0; /* not supported */
|
value->u32 = 0; /* not supported */
|
||||||
@ -443,7 +443,7 @@ tcp_ListenerTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t
|
|||||||
if (idx == 0) {
|
if (idx == 0) {
|
||||||
return SNMP_ERR_NOSUCHINSTANCE;
|
return SNMP_ERR_NOSUCHINSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find tcp_pcb with requested ip and port*/
|
/* find tcp_pcb with requested ip and port*/
|
||||||
pcb = tcp_listen_pcbs.listen_pcbs;
|
pcb = tcp_listen_pcbs.listen_pcbs;
|
||||||
while (pcb != NULL) {
|
while (pcb != NULL) {
|
||||||
@ -456,7 +456,7 @@ tcp_ListenerTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* not found */
|
/* not found */
|
||||||
return SNMP_ERR_NOSUCHINSTANCE;
|
return SNMP_ERR_NOSUCHINSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static snmp_err_t
|
static snmp_err_t
|
||||||
@ -477,13 +477,13 @@ tcp_ListenerTable_get_next_cell_instance_and_value(const u32_t* column, struct s
|
|||||||
while (pcb != NULL) {
|
while (pcb != NULL) {
|
||||||
u8_t idx = 0;
|
u8_t idx = 0;
|
||||||
u32_t test_oid[LWIP_ARRAYSIZE(result_temp)];
|
u32_t test_oid[LWIP_ARRAYSIZE(result_temp)];
|
||||||
|
|
||||||
/* tcpListenerLocalAddressType + tcpListenerLocalAddress + tcpListenerLocalPort */
|
/* tcpListenerLocalAddressType + tcpListenerLocalAddress + tcpListenerLocalPort */
|
||||||
idx += snmp_ip_port_to_oid(&pcb->local_ip, pcb->local_port, &test_oid[idx]);
|
idx += snmp_ip_port_to_oid(&pcb->local_ip, pcb->local_port, &test_oid[idx]);
|
||||||
|
|
||||||
/* check generated OID: is it a candidate for the next one? */
|
/* check generated OID: is it a candidate for the next one? */
|
||||||
snmp_next_oid_check(&state, test_oid, idx, NULL);
|
snmp_next_oid_check(&state, test_oid, idx, NULL);
|
||||||
|
|
||||||
pcb = pcb->next;
|
pcb = pcb->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -528,7 +528,7 @@ static const struct snmp_table_simple_node tcp_ConnTable = SNMP_TABLE_CREATE_SIM
|
|||||||
#endif /* LWIP_IPV4 */
|
#endif /* LWIP_IPV4 */
|
||||||
|
|
||||||
static const struct snmp_table_simple_col_def tcp_ConnectionTable_columns[] = {
|
static const struct snmp_table_simple_col_def tcp_ConnectionTable_columns[] = {
|
||||||
/* all items except tcpConnectionState and tcpConnectionProcess are declared as not-accessible */
|
/* all items except tcpConnectionState and tcpConnectionProcess are declared as not-accessible */
|
||||||
{ 7, SNMP_ASN1_TYPE_INTEGER, SNMP_VARIANT_VALUE_TYPE_U32 }, /* tcpConnectionState */
|
{ 7, SNMP_ASN1_TYPE_INTEGER, SNMP_VARIANT_VALUE_TYPE_U32 }, /* tcpConnectionState */
|
||||||
{ 8, SNMP_ASN1_TYPE_UNSIGNED32, SNMP_VARIANT_VALUE_TYPE_U32 } /* tcpConnectionProcess */
|
{ 8, SNMP_ASN1_TYPE_UNSIGNED32, SNMP_VARIANT_VALUE_TYPE_U32 } /* tcpConnectionProcess */
|
||||||
};
|
};
|
||||||
@ -537,13 +537,13 @@ static const struct snmp_table_simple_node tcp_ConnectionTable = SNMP_TABLE_CREA
|
|||||||
|
|
||||||
|
|
||||||
static const struct snmp_table_simple_col_def tcp_ListenerTable_columns[] = {
|
static const struct snmp_table_simple_col_def tcp_ListenerTable_columns[] = {
|
||||||
/* all items except tcpListenerProcess are declared as not-accessible */
|
/* all items except tcpListenerProcess are declared as not-accessible */
|
||||||
{ 4, SNMP_ASN1_TYPE_UNSIGNED32, SNMP_VARIANT_VALUE_TYPE_U32 } /* tcpListenerProcess */
|
{ 4, SNMP_ASN1_TYPE_UNSIGNED32, SNMP_VARIANT_VALUE_TYPE_U32 } /* tcpListenerProcess */
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct snmp_table_simple_node tcp_ListenerTable = SNMP_TABLE_CREATE_SIMPLE(20, tcp_ListenerTable_columns, tcp_ListenerTable_get_cell_value, tcp_ListenerTable_get_next_cell_instance_and_value);
|
static const struct snmp_table_simple_node tcp_ListenerTable = SNMP_TABLE_CREATE_SIMPLE(20, tcp_ListenerTable_columns, tcp_ListenerTable_get_cell_value, tcp_ListenerTable_get_next_cell_instance_and_value);
|
||||||
|
|
||||||
/* the following nodes access variables in LWIP stack from SNMP worker thread and must therefore be synced to LWIP (TCPIP) thread */
|
/* the following nodes access variables in LWIP stack from SNMP worker thread and must therefore be synced to LWIP (TCPIP) thread */
|
||||||
CREATE_LWIP_SYNC_NODE( 1, tcp_RtoAlgorithm)
|
CREATE_LWIP_SYNC_NODE( 1, tcp_RtoAlgorithm)
|
||||||
CREATE_LWIP_SYNC_NODE( 2, tcp_RtoMin)
|
CREATE_LWIP_SYNC_NODE( 2, tcp_RtoMin)
|
||||||
CREATE_LWIP_SYNC_NODE( 3, tcp_RtoMax)
|
CREATE_LWIP_SYNC_NODE( 3, tcp_RtoMax)
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
/* --- udp .1.3.6.1.2.1.7 ----------------------------------------------------- */
|
/* --- udp .1.3.6.1.2.1.7 ----------------------------------------------------- */
|
||||||
|
|
||||||
static s16_t
|
static s16_t
|
||||||
udp_get_value(struct snmp_node_instance* instance, void* value)
|
udp_get_value(struct snmp_node_instance* instance, void* value)
|
||||||
{
|
{
|
||||||
u32_t *uint_ptr = (u32_t*)value;
|
u32_t *uint_ptr = (u32_t*)value;
|
||||||
@ -91,10 +91,10 @@ udp_get_value(struct snmp_node_instance* instance, void* value)
|
|||||||
|
|
||||||
/* --- udpEndpointTable --- */
|
/* --- udpEndpointTable --- */
|
||||||
|
|
||||||
static snmp_err_t
|
static snmp_err_t
|
||||||
udp_endpointTable_get_cell_value_core(const u32_t* column, union snmp_variant_value* value)
|
udp_endpointTable_get_cell_value_core(const u32_t* column, union snmp_variant_value* value)
|
||||||
{
|
{
|
||||||
/* all items except udpEndpointProcess are declared as not-accessible */
|
/* all items except udpEndpointProcess are declared as not-accessible */
|
||||||
switch (*column) {
|
switch (*column) {
|
||||||
case 8: /* udpEndpointProcess */
|
case 8: /* udpEndpointProcess */
|
||||||
value->u32 = 0; /* not supported */
|
value->u32 = 0; /* not supported */
|
||||||
@ -106,7 +106,7 @@ udp_endpointTable_get_cell_value_core(const u32_t* column, union snmp_variant_va
|
|||||||
return SNMP_ERR_NOERROR;
|
return SNMP_ERR_NOERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static snmp_err_t
|
static snmp_err_t
|
||||||
udp_endpointTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, union snmp_variant_value* value, u32_t* value_len)
|
udp_endpointTable_get_cell_value(const u32_t* column, const u32_t* row_oid, u8_t row_oid_len, union snmp_variant_value* value, u32_t* value_len)
|
||||||
{
|
{
|
||||||
ip_addr_t local_ip, remote_ip;
|
ip_addr_t local_ip, remote_ip;
|
||||||
|
@ -110,7 +110,7 @@ autoip_set_struct(struct netif *netif, struct autoip *autoip)
|
|||||||
{
|
{
|
||||||
LWIP_ASSERT("netif != NULL", netif != NULL);
|
LWIP_ASSERT("netif != NULL", netif != NULL);
|
||||||
LWIP_ASSERT("autoip != NULL", autoip != NULL);
|
LWIP_ASSERT("autoip != NULL", autoip != NULL);
|
||||||
LWIP_ASSERT("netif already has a struct autoip set",
|
LWIP_ASSERT("netif already has a struct autoip set",
|
||||||
netif_autoip_data(netif) == NULL);
|
netif_autoip_data(netif) == NULL);
|
||||||
|
|
||||||
/* clear data structure */
|
/* clear data structure */
|
||||||
@ -522,7 +522,7 @@ autoip_supplied_address(const struct netif *netif)
|
|||||||
u8_t
|
u8_t
|
||||||
autoip_accept_packet(struct netif *netif, const ip4_addr_t *addr)
|
autoip_accept_packet(struct netif *netif, const ip4_addr_t *addr)
|
||||||
{
|
{
|
||||||
struct autoip* autoip = netif_autoip_data(netif);
|
struct autoip* autoip = netif_autoip_data(netif);
|
||||||
return (autoip != NULL) && ip4_addr_cmp(addr, &(autoip->llipaddr));
|
return (autoip != NULL) && ip4_addr_cmp(addr, &(autoip->llipaddr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,11 +214,11 @@ dhcp_inc_pcb_refcount(void)
|
|||||||
/* set up local and remote port for the pcb -> listen on all interfaces on all src/dest IPs */
|
/* set up local and remote port for the pcb -> listen on all interfaces on all src/dest IPs */
|
||||||
udp_bind(dhcp_pcb, IP_ADDR_ANY, DHCP_CLIENT_PORT);
|
udp_bind(dhcp_pcb, IP_ADDR_ANY, DHCP_CLIENT_PORT);
|
||||||
udp_connect(dhcp_pcb, IP_ADDR_ANY, DHCP_SERVER_PORT);
|
udp_connect(dhcp_pcb, IP_ADDR_ANY, DHCP_SERVER_PORT);
|
||||||
udp_recv(dhcp_pcb, dhcp_recv, NULL);
|
udp_recv(dhcp_pcb, dhcp_recv, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
dhcp_pcb_refcount++;
|
dhcp_pcb_refcount++;
|
||||||
|
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ dhcp_dec_pcb_refcount(void)
|
|||||||
{
|
{
|
||||||
LWIP_ASSERT("dhcp_pcb_refcount(): refcount error", (dhcp_pcb_refcount > 0));
|
LWIP_ASSERT("dhcp_pcb_refcount(): refcount error", (dhcp_pcb_refcount > 0));
|
||||||
dhcp_pcb_refcount--;
|
dhcp_pcb_refcount--;
|
||||||
|
|
||||||
if (dhcp_pcb_refcount == 0) {
|
if (dhcp_pcb_refcount == 0) {
|
||||||
udp_remove(dhcp_pcb);
|
udp_remove(dhcp_pcb);
|
||||||
dhcp_pcb = NULL;
|
dhcp_pcb = NULL;
|
||||||
@ -728,7 +728,7 @@ dhcp_start(struct netif *netif)
|
|||||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): could not allocate dhcp\n"));
|
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): could not allocate dhcp\n"));
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* store this dhcp client in the netif */
|
/* store this dhcp client in the netif */
|
||||||
netif->client_data[LWIP_NETIF_CLIENT_DATA_INDEX_DHCP] = dhcp;
|
netif->client_data[LWIP_NETIF_CLIENT_DATA_INDEX_DHCP] = dhcp;
|
||||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): allocated dhcp"));
|
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): allocated dhcp"));
|
||||||
@ -748,7 +748,7 @@ dhcp_start(struct netif *netif)
|
|||||||
memset(dhcp, 0, sizeof(struct dhcp));
|
memset(dhcp, 0, sizeof(struct dhcp));
|
||||||
/* dhcp_set_state(&dhcp, DHCP_STATE_OFF); */
|
/* dhcp_set_state(&dhcp, DHCP_STATE_OFF); */
|
||||||
|
|
||||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): starting DHCP configuration\n"));
|
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): starting DHCP configuration\n"));
|
||||||
|
|
||||||
if (dhcp_inc_pcb_refcount() != ERR_OK) { /* ensure DHCP PCB is allocated */
|
if (dhcp_inc_pcb_refcount() != ERR_OK) { /* ensure DHCP PCB is allocated */
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
@ -810,7 +810,7 @@ dhcp_inform(struct netif *netif)
|
|||||||
pbuf_realloc(dhcp.p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp.options_out_len);
|
pbuf_realloc(dhcp.p_out, sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN + dhcp.options_out_len);
|
||||||
|
|
||||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_inform: INFORMING\n"));
|
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_inform: INFORMING\n"));
|
||||||
|
|
||||||
udp_sendto_if(dhcp_pcb, dhcp.p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif);
|
udp_sendto_if(dhcp_pcb, dhcp.p_out, IP_ADDR_BROADCAST, DHCP_SERVER_PORT, netif);
|
||||||
|
|
||||||
dhcp_delete_msg(&dhcp);
|
dhcp_delete_msg(&dhcp);
|
||||||
@ -1659,7 +1659,7 @@ dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr,
|
|||||||
struct dhcp_msg *reply_msg = (struct dhcp_msg *)p->payload;
|
struct dhcp_msg *reply_msg = (struct dhcp_msg *)p->payload;
|
||||||
u8_t msg_type;
|
u8_t msg_type;
|
||||||
u8_t i;
|
u8_t i;
|
||||||
|
|
||||||
LWIP_UNUSED_ARG(arg);
|
LWIP_UNUSED_ARG(arg);
|
||||||
|
|
||||||
/* Caught DHCP message from netif that does not have DHCP enabled? -> not interested */
|
/* Caught DHCP message from netif that does not have DHCP enabled? -> not interested */
|
||||||
@ -1668,7 +1668,7 @@ dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
LWIP_ASSERT("invalid server address type", IP_IS_V4(addr));
|
LWIP_ASSERT("invalid server address type", IP_IS_V4(addr));
|
||||||
|
|
||||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_recv(pbuf = %p) from DHCP server %"U16_F".%"U16_F".%"U16_F".%"U16_F" port %"U16_F"\n", (void*)p,
|
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_recv(pbuf = %p) from DHCP server %"U16_F".%"U16_F".%"U16_F".%"U16_F" port %"U16_F"\n", (void*)p,
|
||||||
ip4_addr1_16(ip_2_ip4(addr)), ip4_addr2_16(ip_2_ip4(addr)), ip4_addr3_16(ip_2_ip4(addr)), ip4_addr4_16(ip_2_ip4(addr)), port));
|
ip4_addr1_16(ip_2_ip4(addr)), ip4_addr2_16(ip_2_ip4(addr)), ip4_addr3_16(ip_2_ip4(addr)), ip4_addr4_16(ip_2_ip4(addr)), port));
|
||||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("pbuf->len = %"U16_F"\n", p->len));
|
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("pbuf->len = %"U16_F"\n", p->len));
|
||||||
|
@ -452,7 +452,7 @@ ip6_input(struct pbuf *p, struct netif *inp)
|
|||||||
IP6_STATS_INC(ip6.drop);
|
IP6_STATS_INC(ip6.drop);
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* current header pointer. */
|
/* current header pointer. */
|
||||||
ip_data.current_ip6_header = ip6hdr;
|
ip_data.current_ip6_header = ip6hdr;
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ raw_input_match(struct raw_pcb *pcb, u8_t broadcast)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif /* LWIP_IPV4 && LWIP_IPV6 */
|
#endif /* LWIP_IPV4 && LWIP_IPV6 */
|
||||||
|
|
||||||
/* Only need to check PCB if incoming IP version matches PCB IP version */
|
/* Only need to check PCB if incoming IP version matches PCB IP version */
|
||||||
if (IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ip_current_dest_addr())) {
|
if (IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ip_current_dest_addr())) {
|
||||||
#if LWIP_IPV4
|
#if LWIP_IPV4
|
||||||
@ -103,7 +103,7 @@ raw_input_match(struct raw_pcb *pcb, u8_t broadcast)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ tcp_input(struct pbuf *p, struct netif *inp)
|
|||||||
|
|
||||||
/* remember the pointer to the second part of the options */
|
/* remember the pointer to the second part of the options */
|
||||||
tcphdr_opt2 = (u8_t*)p->next->payload;
|
tcphdr_opt2 = (u8_t*)p->next->payload;
|
||||||
|
|
||||||
/* advance p->next to point after the options, and manually
|
/* advance p->next to point after the options, and manually
|
||||||
adjust p->tot_len to keep it consistent with the changed p->next */
|
adjust p->tot_len to keep it consistent with the changed p->next */
|
||||||
pbuf_header(p->next, -(s16_t)opt2len);
|
pbuf_header(p->next, -(s16_t)opt2len);
|
||||||
|
@ -191,7 +191,7 @@ udp_input_local_match(struct udp_pcb *pcb, struct netif *inp, u8_t broadcast)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ err_t netconn_gethostbyname(const char *name, ip_addr_t *addr);
|
|||||||
|
|
||||||
#if LWIP_IPV6
|
#if LWIP_IPV6
|
||||||
/** @ingroup netconn_common
|
/** @ingroup netconn_common
|
||||||
* TCP: Set the IPv6 ONLY status of netconn calls (see NETCONN_FLAG_IPV6_V6ONLY)
|
* TCP: Set the IPv6 ONLY status of netconn calls (see NETCONN_FLAG_IPV6_V6ONLY)
|
||||||
*/
|
*/
|
||||||
#define netconn_set_ipv6only(conn, val) do { if(val) { \
|
#define netconn_set_ipv6only(conn, val) do { if(val) { \
|
||||||
(conn)->flags |= NETCONN_FLAG_IPV6_V6ONLY; \
|
(conn)->flags |= NETCONN_FLAG_IPV6_V6ONLY; \
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LWIP_HDR_APPS_MDNS_OPTS_H
|
#ifndef LWIP_HDR_APPS_MDNS_OPTS_H
|
||||||
#define LWIP_HDR_APPS_MDNS_OPTS_H
|
#define LWIP_HDR_APPS_MDNS_OPTS_H
|
||||||
|
|
||||||
#include "lwip/opt.h"
|
#include "lwip/opt.h"
|
||||||
|
|
||||||
@ -70,5 +70,5 @@
|
|||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#endif /* LWIP_HDR_APPS_MDNS_OPTS_H */
|
#endif /* LWIP_HDR_APPS_MDNS_OPTS_H */
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ struct snmp_node_instance
|
|||||||
u8_t asn1_type;
|
u8_t asn1_type;
|
||||||
/** one out of instance access types defined above (SNMP_NODE_INSTANCE_READ_ONLY,...) */
|
/** one out of instance access types defined above (SNMP_NODE_INSTANCE_READ_ONLY,...) */
|
||||||
snmp_access_t access;
|
snmp_access_t access;
|
||||||
|
|
||||||
/** returns object value for the given object identifier. Return values <0 to indicate an error */
|
/** returns object value for the given object identifier. Return values <0 to indicate an error */
|
||||||
node_instance_get_value_method get_value;
|
node_instance_get_value_method get_value;
|
||||||
/** tests length and/or range BEFORE setting */
|
/** tests length and/or range BEFORE setting */
|
||||||
@ -278,7 +278,7 @@ struct snmp_next_oid_state
|
|||||||
u32_t* next_oid;
|
u32_t* next_oid;
|
||||||
u8_t next_oid_len;
|
u8_t next_oid_len;
|
||||||
u8_t next_oid_max_len;
|
u8_t next_oid_max_len;
|
||||||
|
|
||||||
snmp_next_oid_status_t status;
|
snmp_next_oid_status_t status;
|
||||||
void* reference;
|
void* reference;
|
||||||
};
|
};
|
||||||
|
@ -85,7 +85,7 @@ snmp_err_t snmp_table_get_next_instance(const u32_t *root_oid, u8_t root_oid_len
|
|||||||
|
|
||||||
#define SNMP_TABLE_GET_COLUMN_FROM_OID(oid) ((oid)[1]) /* first array value is (fixed) row entry (fixed to 1) and 2nd value is column, follow3ed by instance */
|
#define SNMP_TABLE_GET_COLUMN_FROM_OID(oid) ((oid)[1]) /* first array value is (fixed) row entry (fixed to 1) and 2nd value is column, follow3ed by instance */
|
||||||
|
|
||||||
|
|
||||||
/** simple read-only table */
|
/** simple read-only table */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SNMP_VARIANT_VALUE_TYPE_U32,
|
SNMP_VARIANT_VALUE_TYPE_U32,
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
#include "arch/cc.h"
|
#include "arch/cc.h"
|
||||||
|
|
||||||
/** Define this to 1 in arch/cc.h of your port if your compiler does not provide
|
/** Define this to 1 in arch/cc.h of your port if your compiler does not provide
|
||||||
* the stdint.h header. This cannot be \#defined in lwipopts.h since
|
* the stdint.h header. This cannot be \#defined in lwipopts.h since
|
||||||
* this is not an option of lwIP itself, but an option of the lwIP port
|
* this is not an option of lwIP itself, but an option of the lwIP port
|
||||||
* to your system.
|
* to your system.
|
||||||
* Additionally, this header is meant to be \#included in lwipopts.h
|
* Additionally, this header is meant to be \#included in lwipopts.h
|
||||||
@ -71,7 +71,7 @@ typedef uintptr_t mem_ptr_t;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Define this to 1 in arch/cc.h of your port if your compiler does not provide
|
/** Define this to 1 in arch/cc.h of your port if your compiler does not provide
|
||||||
* the inttypes.h header. This cannot be \#defined in lwipopts.h since
|
* the inttypes.h header. This cannot be \#defined in lwipopts.h since
|
||||||
* this is not an option of lwIP itself, but an option of the lwIP port
|
* this is not an option of lwIP itself, but an option of the lwIP port
|
||||||
* to your system.
|
* to your system.
|
||||||
* Additionally, this header is meant to be \#included in lwipopts.h
|
* Additionally, this header is meant to be \#included in lwipopts.h
|
||||||
|
@ -60,7 +60,7 @@ typedef s8_t err_t;
|
|||||||
/** Definitions for error constants. */
|
/** Definitions for error constants. */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
/** No error, everything OK. */
|
/** No error, everything OK. */
|
||||||
ERR_OK = 0,
|
ERR_OK = 0,
|
||||||
/** Out of memory error. */
|
/** Out of memory error. */
|
||||||
ERR_MEM = -1,
|
ERR_MEM = -1,
|
||||||
/** Buffer error. */
|
/** Buffer error. */
|
||||||
|
@ -59,7 +59,7 @@ extern "C" {
|
|||||||
#if LWIP_IPV4 && LWIP_ARP /* don't build if not configured for use in lwipopts.h */
|
#if LWIP_IPV4 && LWIP_ARP /* don't build if not configured for use in lwipopts.h */
|
||||||
|
|
||||||
#include "lwip/prot/arp.h"
|
#include "lwip/prot/arp.h"
|
||||||
|
|
||||||
#define SIZEOF_ETHARP_PACKET (SIZEOF_ETH_HDR + SIZEOF_ETHARP_HDR)
|
#define SIZEOF_ETHARP_PACKET (SIZEOF_ETH_HDR + SIZEOF_ETHARP_HDR)
|
||||||
#if ETHARP_SUPPORT_VLAN && defined(LWIP_HOOK_VLAN_SET)
|
#if ETHARP_SUPPORT_VLAN && defined(LWIP_HOOK_VLAN_SET)
|
||||||
#define SIZEOF_ETHARP_PACKET_TX (SIZEOF_ETHARP_PACKET + SIZEOF_VLAN_HDR)
|
#define SIZEOF_ETHARP_PACKET_TX (SIZEOF_ETHARP_PACKET + SIZEOF_VLAN_HDR)
|
||||||
|
@ -62,7 +62,7 @@ enum icmp6_type {
|
|||||||
/** Parameter problem */
|
/** Parameter problem */
|
||||||
ICMP6_TYPE_PP = 4,
|
ICMP6_TYPE_PP = 4,
|
||||||
/** Private experimentation */
|
/** Private experimentation */
|
||||||
ICMP6_TYPE_PE1 = 100,
|
ICMP6_TYPE_PE1 = 100,
|
||||||
/** Private experimentation */
|
/** Private experimentation */
|
||||||
ICMP6_TYPE_PE2 = 101,
|
ICMP6_TYPE_PE2 = 101,
|
||||||
/** Reserved for expansion of error messages */
|
/** Reserved for expansion of error messages */
|
||||||
@ -73,7 +73,7 @@ enum icmp6_type {
|
|||||||
/** Echo reply */
|
/** Echo reply */
|
||||||
ICMP6_TYPE_EREP = 129,
|
ICMP6_TYPE_EREP = 129,
|
||||||
/** Multicast listener query */
|
/** Multicast listener query */
|
||||||
ICMP6_TYPE_MLQ = 130,
|
ICMP6_TYPE_MLQ = 130,
|
||||||
/** Multicast listener report */
|
/** Multicast listener report */
|
||||||
ICMP6_TYPE_MLR = 131,
|
ICMP6_TYPE_MLR = 131,
|
||||||
/** Multicast listener done */
|
/** Multicast listener done */
|
||||||
|
@ -248,9 +248,9 @@ extern struct ip_globals ip_data;
|
|||||||
(IP_IS_V6(dest) ? \
|
(IP_IS_V6(dest) ? \
|
||||||
ip6_output_hinted(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, addr_hint) : \
|
ip6_output_hinted(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, addr_hint) : \
|
||||||
ip4_output_hinted(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, addr_hint))
|
ip4_output_hinted(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, addr_hint))
|
||||||
/**
|
/**
|
||||||
* @ingroup ip
|
* @ingroup ip
|
||||||
* Get netif for address combination. See \ref ip6_route and \ref ip4_route
|
* Get netif for address combination. See \ref ip6_route and \ref ip4_route
|
||||||
*/
|
*/
|
||||||
#define ip_route(src, dest) \
|
#define ip_route(src, dest) \
|
||||||
(IP_IS_V6(dest) ? \
|
(IP_IS_V6(dest) ? \
|
||||||
|
@ -68,7 +68,7 @@ extern "C" {
|
|||||||
* @ingroup netif
|
* @ingroup netif
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** Whether the network interface is 'up'. This is
|
/** Whether the network interface is 'up'. This is
|
||||||
* a software flag used to control whether this network
|
* a software flag used to control whether this network
|
||||||
* interface is enabled and processes traffic.
|
* interface is enabled and processes traffic.
|
||||||
|
@ -36,8 +36,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NOTE: || defined __DOXYGEN__ is a workaround for doxygen bug -
|
* NOTE: || defined __DOXYGEN__ is a workaround for doxygen bug -
|
||||||
* without this, doxygen does not see the actual #define
|
* without this, doxygen does not see the actual #define
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -51,7 +51,7 @@
|
|||||||
#include "lwipopts.h"
|
#include "lwipopts.h"
|
||||||
#include "lwip/debug.h"
|
#include "lwip/debug.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup lwip_opts Options (lwipopts.h)
|
* @defgroup lwip_opts Options (lwipopts.h)
|
||||||
* @ingroup lwip
|
* @ingroup lwip
|
||||||
*
|
*
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct pbuf;
|
struct pbuf;
|
||||||
struct netif;
|
struct netif;
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ PACK_STRUCT_END
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SIZEOF_ETHARP_HDR 28
|
#define SIZEOF_ETHARP_HDR 28
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -138,7 +138,7 @@ PACK_STRUCT_END
|
|||||||
#ifndef ETHADDR16_COPY
|
#ifndef ETHADDR16_COPY
|
||||||
#define ETHADDR16_COPY(dst, src) SMEMCPY(dst, src, ETH_HWADDR_LEN)
|
#define ETHADDR16_COPY(dst, src) SMEMCPY(dst, src, ETH_HWADDR_LEN)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define eth_addr_cmp(addr1, addr2) (memcmp((addr1)->addr, (addr2)->addr, ETH_HWADDR_LEN) == 0)
|
#define eth_addr_cmp(addr1, addr2) (memcmp((addr1)->addr, (addr2)->addr, ETH_HWADDR_LEN) == 0)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -49,5 +49,3 @@
|
|||||||
#define IP_HDR_GET_VERSION(ptr) ((*(u8_t*)(ptr)) >> 4)
|
#define IP_HDR_GET_VERSION(ptr) ((*(u8_t*)(ptr)) >> 4)
|
||||||
|
|
||||||
#endif /* LWIP_HDR_PROT_IP_H */
|
#endif /* LWIP_HDR_PROT_IP_H */
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ extern "C" {
|
|||||||
|
|
||||||
/* Size of the IPv4 header. Same as 'sizeof(struct ip_hdr)'. */
|
/* Size of the IPv4 header. Same as 'sizeof(struct ip_hdr)'. */
|
||||||
#define IP_HLEN 20
|
#define IP_HLEN 20
|
||||||
|
|
||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
# include "arch/bpstruct.h"
|
# include "arch/bpstruct.h"
|
||||||
#endif
|
#endif
|
||||||
@ -109,5 +109,3 @@ PACK_STRUCT_END
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* LWIP_HDR_PROT_IP4_H */
|
#endif /* LWIP_HDR_PROT_IP4_H */
|
||||||
|
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ PACK_STRUCT_END
|
|||||||
#define IP6H_PLEN_SET(hdr, plen) (hdr)->_plen = htons(plen)
|
#define IP6H_PLEN_SET(hdr, plen) (hdr)->_plen = htons(plen)
|
||||||
#define IP6H_NEXTH_SET(hdr, nexth) (hdr)->_nexth = (nexth)
|
#define IP6H_NEXTH_SET(hdr, nexth) (hdr)->_nexth = (nexth)
|
||||||
#define IP6H_HOPLIM_SET(hdr, hl) (hdr)->_hoplim = (u8_t)(hl)
|
#define IP6H_HOPLIM_SET(hdr, hl) (hdr)->_hoplim = (u8_t)(hl)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -62,7 +62,7 @@ PACK_STRUCT_END
|
|||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
# include "arch/epstruct.h"
|
# include "arch/epstruct.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -77,7 +77,7 @@ PACK_STRUCT_END
|
|||||||
|
|
||||||
#define TCPH_SET_FLAG(phdr, flags ) (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags | htons(flags))
|
#define TCPH_SET_FLAG(phdr, flags ) (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags | htons(flags))
|
||||||
#define TCPH_UNSET_FLAG(phdr, flags) (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags & ~htons(flags))
|
#define TCPH_UNSET_FLAG(phdr, flags) (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags & ~htons(flags))
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -60,7 +60,7 @@ PACK_STRUCT_END
|
|||||||
#ifdef PACK_STRUCT_USE_INCLUDES
|
#ifdef PACK_STRUCT_USE_INCLUDES
|
||||||
# include "arch/epstruct.h"
|
# include "arch/epstruct.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -189,16 +189,16 @@ struct stats_mib2_netif_ctrs {
|
|||||||
/** The number of packets, delivered by this sub-layer to a higher (sub-)layer, which were
|
/** The number of packets, delivered by this sub-layer to a higher (sub-)layer, which were
|
||||||
* not addressed to a multicast or broadcast address at this sub-layer */
|
* not addressed to a multicast or broadcast address at this sub-layer */
|
||||||
u32_t ifinucastpkts;
|
u32_t ifinucastpkts;
|
||||||
/** The number of packets, delivered by this sub-layer to a higher (sub-)layer, which were
|
/** The number of packets, delivered by this sub-layer to a higher (sub-)layer, which were
|
||||||
* addressed to a multicast or broadcast address at this sub-layer */
|
* addressed to a multicast or broadcast address at this sub-layer */
|
||||||
u32_t ifinnucastpkts;
|
u32_t ifinnucastpkts;
|
||||||
/** The number of inbound packets which were chosen to be discarded even though no errors had
|
/** The number of inbound packets which were chosen to be discarded even though no errors had
|
||||||
* been detected to prevent their being deliverable to a higher-layer protocol. One possible
|
* been detected to prevent their being deliverable to a higher-layer protocol. One possible
|
||||||
* reason for discarding such a packet could be to free up buffer space */
|
* reason for discarding such a packet could be to free up buffer space */
|
||||||
u32_t ifindiscards;
|
u32_t ifindiscards;
|
||||||
/** For packet-oriented interfaces, the number of inbound packets that contained errors
|
/** For packet-oriented interfaces, the number of inbound packets that contained errors
|
||||||
* preventing them from being deliverable to a higher-layer protocol. For character-
|
* preventing them from being deliverable to a higher-layer protocol. For character-
|
||||||
* oriented or fixed-length interfaces, the number of inbound transmission units that
|
* oriented or fixed-length interfaces, the number of inbound transmission units that
|
||||||
* contained errors preventing them from being deliverable to a higher-layer protocol. */
|
* contained errors preventing them from being deliverable to a higher-layer protocol. */
|
||||||
u32_t ifinerrors;
|
u32_t ifinerrors;
|
||||||
/** For packet-oriented interfaces, the number of packets received via the interface which
|
/** For packet-oriented interfaces, the number of packets received via the interface which
|
||||||
@ -408,7 +408,7 @@ void stats_init(void);
|
|||||||
#define MEMP_STATS_DISPLAY(i)
|
#define MEMP_STATS_DISPLAY(i)
|
||||||
#define MEMP_STATS_GET(x, i) 0
|
#define MEMP_STATS_GET(x, i) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SYS_STATS
|
#if SYS_STATS
|
||||||
#define SYS_STATS_INC(x) STATS_INC(sys.x)
|
#define SYS_STATS_INC(x) STATS_INC(sys.x)
|
||||||
#define SYS_STATS_DEC(x) STATS_DEC(sys.x)
|
#define SYS_STATS_DEC(x) STATS_DEC(sys.x)
|
||||||
|
@ -60,10 +60,10 @@
|
|||||||
* @defgroup sys_prot Critical sections
|
* @defgroup sys_prot Critical sections
|
||||||
* @ingroup sys_layer
|
* @ingroup sys_layer
|
||||||
* Used to protect short regions of code against concurrent access.
|
* Used to protect short regions of code against concurrent access.
|
||||||
* - Your system is a bare-metal system (probably with an RTOS)
|
* - Your system is a bare-metal system (probably with an RTOS)
|
||||||
* and interrupts are under your control:
|
* and interrupts are under your control:
|
||||||
* Implement this as LockInterrupts() / UnlockInterrupts()
|
* Implement this as LockInterrupts() / UnlockInterrupts()
|
||||||
* - Your system uses an RTOS with deferred interrupt handling from a
|
* - Your system uses an RTOS with deferred interrupt handling from a
|
||||||
* worker thread: Implement as a global mutex or lock/unlock scheduler
|
* worker thread: Implement as a global mutex or lock/unlock scheduler
|
||||||
* - Your system uses a high-level OS with e.g. POSIX signals:
|
* - Your system uses a high-level OS with e.g. POSIX signals:
|
||||||
* Implement as a global mutex
|
* Implement as a global mutex
|
||||||
|
@ -76,7 +76,7 @@ err_t tcpip_inpkt(struct pbuf *p, struct netif *inp, netif_input_fn input_fn);
|
|||||||
err_t tcpip_input(struct pbuf *p, struct netif *inp);
|
err_t tcpip_input(struct pbuf *p, struct netif *inp);
|
||||||
|
|
||||||
err_t tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8_t block);
|
err_t tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8_t block);
|
||||||
/**
|
/**
|
||||||
* @ingroup lwip_os
|
* @ingroup lwip_os
|
||||||
* @see tcpip_callback_with_block
|
* @see tcpip_callback_with_block
|
||||||
*/
|
*/
|
||||||
|
@ -266,7 +266,7 @@ ethernetif_input(struct netif *netif)
|
|||||||
/* if no packet could be read, silently ignore this */
|
/* if no packet could be read, silently ignore this */
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
/* pass all packets to ethernet_input, which decides what packets it supports */
|
/* pass all packets to ethernet_input, which decides what packets it supports */
|
||||||
if (netif->input(p, netif) != ERR_OK) {
|
if (netif->input(p, netif) != ERR_OK) {
|
||||||
LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
|
LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
|
||||||
pbuf_free(p);
|
pbuf_free(p);
|
||||||
p = NULL;
|
p = NULL;
|
||||||
|
@ -42,10 +42,10 @@
|
|||||||
/**
|
/**
|
||||||
* @defgroup slipif SLIP netif
|
* @defgroup slipif SLIP netif
|
||||||
* @ingroup addons
|
* @ingroup addons
|
||||||
*
|
*
|
||||||
* This is an arch independent SLIP netif. The specific serial hooks must be
|
* This is an arch independent SLIP netif. The specific serial hooks must be
|
||||||
* provided by another file. They are sio_open, sio_read/sio_tryread and sio_send
|
* provided by another file. They are sio_open, sio_read/sio_tryread and sio_send
|
||||||
*
|
*
|
||||||
* Usage: This netif can be used in three ways:\n
|
* Usage: This netif can be used in three ways:\n
|
||||||
* 1) For NO_SYS==0, an RX thread can be used which blocks on sio_read()
|
* 1) For NO_SYS==0, an RX thread can be used which blocks on sio_read()
|
||||||
* until data is received.\n
|
* until data is received.\n
|
||||||
|
Loading…
x
Reference in New Issue
Block a user