Replaced struct ip_addr by typedef ip_addr_t to make changing the actual implementation behind the typedef easier.

This commit is contained in:
goldsimon
2010-02-04 18:47:44 +00:00
parent 24fcf9a86e
commit 5d360a6711
51 changed files with 296 additions and 290 deletions

View File

@@ -1084,7 +1084,7 @@ void snmp_dec_iflist(void)
* Inserts ARP table indexes (.xIfIndex.xNetAddress)
* into arp table index trees (both atTable and ipNetToMediaTable).
*/
void snmp_insert_arpidx_tree(struct netif *ni, struct ip_addr *ip)
void snmp_insert_arpidx_tree(struct netif *ni, ip_addr_t *ip)
{
struct mib_list_rootnode *at_rn;
struct mib_list_node *at_node;
@@ -1156,7 +1156,7 @@ void snmp_insert_arpidx_tree(struct netif *ni, struct ip_addr *ip)
* Removes ARP table indexes (.xIfIndex.xNetAddress)
* from arp table index trees.
*/
void snmp_delete_arpidx_tree(struct netif *ni, struct ip_addr *ip)
void snmp_delete_arpidx_tree(struct netif *ni, ip_addr_t *ip)
{
struct mib_list_rootnode *at_rn, *next, *del_rn[5];
struct mib_list_node *at_n, *del_n[5];
@@ -1437,7 +1437,7 @@ void snmp_delete_ipaddridx_tree(struct netif *ni)
void snmp_insert_iprteidx_tree(u8_t dflt, struct netif *ni)
{
u8_t insert = 0;
struct ip_addr dst;
ip_addr_t dst;
if (dflt != 0)
{
@@ -1514,7 +1514,7 @@ void snmp_insert_iprteidx_tree(u8_t dflt, struct netif *ni)
void snmp_delete_iprteidx_tree(u8_t dflt, struct netif *ni)
{
u8_t del = 0;
struct ip_addr dst;
ip_addr_t dst;
if (dflt != 0)
{
@@ -2723,9 +2723,9 @@ atentry_get_value(struct obj_def *od, u16_t len, void *value)
#if LWIP_ARP
u8_t id;
struct eth_addr* ethaddr_ret;
struct ip_addr* ipaddr_ret;
ip_addr_t* ipaddr_ret;
#endif /* LWIP_ARP */
struct ip_addr ip;
ip_addr_t ip;
struct netif *netif;
LWIP_UNUSED_ARG(len);
@@ -2756,7 +2756,7 @@ atentry_get_value(struct obj_def *od, u16_t len, void *value)
break;
case 3: /* atNetAddress */
{
struct ip_addr *dst = (struct ip_addr*)value;
ip_addr_t *dst = (ip_addr_t*)value;
*dst = *ipaddr_ret;
}
@@ -3071,7 +3071,7 @@ ip_addrentry_get_value(struct obj_def *od, u16_t len, void *value)
{
u8_t id;
u16_t ifidx;
struct ip_addr ip;
ip_addr_t ip;
struct netif *netif = netif_list;
LWIP_UNUSED_ARG(len);
@@ -3091,7 +3091,7 @@ ip_addrentry_get_value(struct obj_def *od, u16_t len, void *value)
{
case 1: /* ipAdEntAddr */
{
struct ip_addr *dst = (struct ip_addr*)value;
ip_addr_t *dst = (ip_addr_t*)value;
*dst = netif->ip_addr;
}
break;
@@ -3103,7 +3103,7 @@ ip_addrentry_get_value(struct obj_def *od, u16_t len, void *value)
break;
case 3: /* ipAdEntNetMask */
{
struct ip_addr *dst = (struct ip_addr*)value;
ip_addr_t *dst = (ip_addr_t*)value;
*dst = netif->netmask;
}
break;
@@ -3211,7 +3211,7 @@ static void
ip_rteentry_get_value(struct obj_def *od, u16_t len, void *value)
{
struct netif *netif;
struct ip_addr dest;
ip_addr_t dest;
s32_t *ident;
u8_t id;
@@ -3241,7 +3241,7 @@ ip_rteentry_get_value(struct obj_def *od, u16_t len, void *value)
{
case 1: /* ipRouteDest */
{
struct ip_addr *dst = (struct ip_addr*)value;
ip_addr_t *dst = (ip_addr_t*)value;
if (ip_addr_isany(&dest))
{
@@ -3290,7 +3290,7 @@ ip_rteentry_get_value(struct obj_def *od, u16_t len, void *value)
break;
case 7: /* ipRouteNextHop */
{
struct ip_addr *dst = (struct ip_addr*)value;
ip_addr_t *dst = (ip_addr_t*)value;
if (ip_addr_isany(&dest))
{
@@ -3337,7 +3337,7 @@ ip_rteentry_get_value(struct obj_def *od, u16_t len, void *value)
break;
case 11: /* ipRouteMask */
{
struct ip_addr *dst = (struct ip_addr*)value;
ip_addr_t *dst = (ip_addr_t*)value;
if (ip_addr_isany(&dest))
{
@@ -3414,9 +3414,9 @@ ip_ntomentry_get_value(struct obj_def *od, u16_t len, void *value)
#if LWIP_ARP
u8_t id;
struct eth_addr* ethaddr_ret;
struct ip_addr* ipaddr_ret;
ip_addr_t* ipaddr_ret;
#endif /* LWIP_ARP */
struct ip_addr ip;
ip_addr_t ip;
struct netif *netif;
LWIP_UNUSED_ARG(len);
@@ -3447,7 +3447,7 @@ ip_ntomentry_get_value(struct obj_def *od, u16_t len, void *value)
break;
case 3: /* ipNetToMediaNetAddress */
{
struct ip_addr *dst = (struct ip_addr*)value;
ip_addr_t *dst = (ip_addr_t*)value;
*dst = *ipaddr_ret;
}
@@ -3772,7 +3772,7 @@ 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)
{
struct ip_addr lip, rip;
ip_addr_t lip, rip;
u16_t lport, rport;
s32_t *ident;
@@ -3881,7 +3881,7 @@ udpentry_get_value(struct obj_def *od, u16_t len, void *value)
{
u8_t id;
struct udp_pcb *pcb;
struct ip_addr ip;
ip_addr_t ip;
u16_t port;
LWIP_UNUSED_ARG(len);
@@ -3905,7 +3905,7 @@ udpentry_get_value(struct obj_def *od, u16_t len, void *value)
{
case 1: /* udpLocalAddress */
{
struct ip_addr *dst = (struct ip_addr*)value;
ip_addr_t *dst = (ip_addr_t*)value;
*dst = pcb->local_ip;
}
break;

View File

@@ -133,7 +133,7 @@ snmp_netiftoifindex(struct netif *netif, s32_t *ifidx)
* @param ip points to output struct
*/
void
snmp_oidtoip(s32_t *ident, struct ip_addr *ip)
snmp_oidtoip(s32_t *ident, ip_addr_t *ip)
{
IP4_ADDR(ip, ident[0], ident[1], ident[2], ident[3]);
}
@@ -144,7 +144,7 @@ snmp_oidtoip(s32_t *ident, struct ip_addr *ip)
* @param ident points to s32_t ident[4] output
*/
void
snmp_iptooid(struct ip_addr *ip, s32_t *ident)
snmp_iptooid(ip_addr_t *ip, s32_t *ident)
{
ident[0] = ip4_addr1(ip);
ident[1] = ip4_addr2(ip);

View File

@@ -58,7 +58,7 @@ struct snmp_msg_pstat msg_input_list[SNMP_CONCURRENT_REQUESTS];
/* UDP Protocol Control Block */
struct udp_pcb *snmp1_pcb;
static void snmp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *addr, u16_t port);
static void snmp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port);
static err_t snmp_pdu_header_check(struct pbuf *p, u16_t ofs, u16_t pdu_len, u16_t *ofs_ret, struct snmp_msg_pstat *m_stat);
static err_t snmp_pdu_dec_varbindlist(struct pbuf *p, u16_t ofs, u16_t *ofs_ret, struct snmp_msg_pstat *m_stat);
@@ -806,7 +806,7 @@ snmp_msg_event(u8_t request_id)
/* lwIP UDP receive callback function */
static void
snmp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *addr, u16_t port)
snmp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *addr, u16_t port)
{
struct snmp_msg_pstat *msg_ps;
u8_t req_idx;

View File

@@ -55,7 +55,7 @@
struct snmp_trap_dst
{
/* destination IP address in network order */
struct ip_addr dip;
ip_addr_t dip;
/* set to 0 when disabled, >0 when enabled */
u8_t enable;
};
@@ -92,7 +92,7 @@ snmp_trap_dst_enable(u8_t dst_idx, u8_t enable)
* @param dst IPv4 address in host order.
*/
void
snmp_trap_dst_ip_set(u8_t dst_idx, struct ip_addr *dst)
snmp_trap_dst_ip_set(u8_t dst_idx, ip_addr_t *dst)
{
if (dst_idx < SNMP_TRAP_DESTINATIONS)
{
@@ -221,7 +221,7 @@ snmp_send_trap(s8_t generic_trap, struct snmp_obj_id *eoid, s32_t specific_trap)
{
struct snmp_trap_dst *td;
struct netif *dst_if;
struct ip_addr dst_ip;
ip_addr_t dst_ip;
struct pbuf *p;
u16_t i,tot_len;