Lines Matching refs:netif

57 #include "netif/etharp.h"
60 #include "netif/ppp_oe.h"
114 struct netif *netif;
135 #define ETHARP_SET_HINT(netif, hint) if (((netif) != NULL) && ((netif)->addr_hint != NULL)) \
136 *((netif)->addr_hint) = (hint);
138 #define ETHARP_SET_HINT(netif, hint) (etharp_cached_entry = (hint))
180 snmp_delete_arpidx_tree(arp_table[i].netif, &arp_table[i].ipaddr);
193 arp_table[i].netif = NULL;
260 * @param netif netif related to this address (used for NETIF_HWADDRHINT)
405 * Send an IP packet on the network using netif->linkoutput
408 * @params netif the lwIP network interface on which to send the packet
415 etharp_send_ip(struct netif *netif, struct pbuf *p, struct eth_addr *src, struct eth_addr *dst)
419 LWIP_ASSERT("netif->hwaddr_len must be the same as ETHARP_HWADDR_LEN for etharp!",
420 (netif->hwaddr_len == ETHARP_HWADDR_LEN));
426 return netif->linkoutput(netif, p);
435 * @param netif netif related to this entry (used for NETIF_ADDRHINT)
448 etharp_update_arp_entry(struct netif *netif, ip_addr_t *ipaddr, struct eth_addr *ethaddr, u8_t flags)
451 LWIP_ASSERT("netif->hwaddr_len == ETHARP_HWADDR_LEN", netif->hwaddr_len == ETHARP_HWADDR_LEN);
458 ip_addr_isbroadcast(ipaddr, netif) ||
482 arp_table[i].netif = netif;
484 snmp_insert_arpidx_tree(netif, &arp_table[i].ipaddr);
509 etharp_send_ip(netif, p, (struct eth_addr*)(netif->hwaddr), ethaddr);
528 struct netif *netif;
534 netif = ip_route(ipaddr);
535 if (netif == NULL) {
539 return etharp_update_arp_entry(netif, ipaddr, ethaddr, ETHARP_FLAG_TRY_HARD | ETHARP_FLAG_STATIC_ENTRY);
575 * Remove all ARP table entries of the specified netif.
577 * @param netif points to a network interface
579 void etharp_cleanup_netif(struct netif *netif)
585 if ((state != ETHARP_STATE_EMPTY) && (arp_table[i].netif == netif)) {
596 * @param netif points to interface index
603 etharp_find_addr(struct netif *netif, ip_addr_t *ipaddr,
611 LWIP_UNUSED_ARG(netif);
631 * @param netif The lwIP network interface on which the IP packet pbuf arrived.
632 * @param p The IP packet that arrived on netif.
639 etharp_ip_input(struct netif *netif, struct pbuf *p)
644 LWIP_ERROR("netif != NULL", (netif != NULL), return;);
659 if (!ip_addr_netcmp(&iphdr_src, &(netif->ip_addr), &(netif->netmask))) {
668 etharp_update_arp_entry(netif, &iphdr_src, &(ethhdr->src), ETHARP_FLAG_FIND_ONLY);
679 * @param netif The lwIP network interface on which the ARP packet pbuf arrived.
680 * @param ethaddr Ethernet address of netif.
681 * @param p The ARP packet that arrived on netif. Is freed by this function.
688 etharp_arp_input(struct netif *netif, struct eth_addr *ethaddr, struct pbuf *p)
699 LWIP_ERROR("netif != NULL", (netif != NULL), return;);
740 autoip_arp_reply(netif, hdr);
749 if (ip_addr_isany(&netif->ip_addr)) {
753 for_us = (u8_t)ip_addr_cmp(&dipaddr, &(netif->ip_addr));
761 etharp_update_arp_entry(netif, &sipaddr, &(hdr->shwaddr),
783 IPADDR2_COPY(&hdr->sipaddr, &netif->ip_addr);
785 LWIP_ASSERT("netif->hwaddr_len must be the same as ETHARP_HWADDR_LEN for etharp!",
786 (netif->hwaddr_len == ETHARP_HWADDR_LEN));
791 ethdst_hwaddr = ip_addr_islinklocal(&netif->ip_addr) ? (u8_t*)(ethbroadcast.addr) : hdr->shwaddr.addr;
807 netif->linkoutput(netif, p);
809 } else if (ip_addr_isany(&netif->ip_addr)) {
810 /* { for_us == 0 and netif->ip_addr.addr == 0 } */
814 /* { for_us == 0 and netif->ip_addr.addr != 0 } */
826 dhcp_arp_reply(netif, &sipaddr);
842 etharp_output_to_arp_index(struct netif *netif, struct pbuf *q, u8_t arp_idx)
851 if (etharp_request(netif, &arp_table[arp_idx].ipaddr) == ERR_OK) {
856 return etharp_send_ip(netif, q, (struct eth_addr*)(netif->hwaddr),
870 * @param netif The lwIP network interface which the IP packet will be sent on.
879 etharp_output(struct netif *netif, struct pbuf *q, ip_addr_t *ipaddr)
885 LWIP_ASSERT("netif != NULL", netif != NULL);
902 if (ip_addr_isbroadcast(ipaddr, netif)) {
921 if (!ip_addr_netcmp(ipaddr, &(netif->ip_addr), &(netif->netmask)) &&
934 if (!ip_addr_isany(&netif->gw)) {
936 dst_addr = &(netif->gw);
945 if (netif->addr_hint != NULL) {
947 u8_t etharp_cached_entry = *(netif->addr_hint);
954 return etharp_output_to_arp_index(netif, q, etharp_cached_entry);
967 ETHARP_SET_HINT(netif, i);
968 return etharp_output_to_arp_index(netif, q, i);
973 return etharp_query(netif, dst_addr, q);
979 return etharp_send_ip(netif, q, (struct eth_addr*)(netif->hwaddr), dest);
998 * @param netif The lwIP network interface on which ipaddr
1016 etharp_query(struct netif *netif, ip_addr_t *ipaddr, struct pbuf *q)
1018 struct eth_addr * srcaddr = (struct eth_addr *)netif->hwaddr;
1023 if (ip_addr_isbroadcast(ipaddr, netif) ||
1056 result = etharp_request(netif, ipaddr);
1073 ETHARP_SET_HINT(netif, i);
1075 result = etharp_send_ip(netif, q, srcaddr, &(arp_table[i].ethaddr));
1159 * @param netif the lwip network interface on which to send the ARP packet
1175 etharp_raw(struct netif *netif, const struct eth_addr *ethsrc_addr,
1189 LWIP_ASSERT("netif != NULL", netif != NULL);
1208 LWIP_ASSERT("netif->hwaddr_len must be the same as ETHARP_HWADDR_LEN for etharp!",
1209 (netif->hwaddr_len == ETHARP_HWADDR_LEN));
1239 result = netif->linkoutput(netif, p);
1252 * @param netif the lwip network interface on which to send the request
1259 etharp_request(struct netif *netif, ip_addr_t *ipaddr)
1262 return etharp_raw(netif, (struct eth_addr *)netif->hwaddr, &ethbroadcast,
1263 (struct eth_addr *)netif->hwaddr, &netif->ip_addr, &ethzero,
1274 * @param netif the network interface on which the packet was received
1277 ethernet_input(struct pbuf *p, struct netif *netif)
1329 netif = LWIP_ARP_FILTER_NETIF_FN(p, netif, htons(type));
1350 if (!(netif->flags & NETIF_FLAG_ETHARP)) {
1355 etharp_ip_input(netif, p);
1363 ip_input(p, netif);
1368 if (!(netif->flags & NETIF_FLAG_ETHARP)) {
1372 etharp_arp_input(netif, (struct eth_addr*)(netif->hwaddr), p);
1377 pppoe_disc_input(netif, p);
1381 pppoe_data_input(netif, p);