Home | History | Annotate | Download | only in netif

Lines Matching refs:netif

57 #include "netif/etharp.h"
60 #include "netif/ppp_oe.h"
103 struct netif *netif;
125 #define ETHARP_SET_HINT(netif, hint) if (((netif) != NULL) && ((netif)->addr_hint != NULL)) \
126 *((netif)->addr_hint) = (hint);
128 #define ETHARP_SET_HINT(netif, hint) (etharp_cached_entry = (hint))
131 static err_t update_arp_entry(struct netif *netif, ip_addr_t *ipaddr, struct eth_addr *ethaddr, u8_t flags);
172 snmp_delete_arpidx_tree(arp_table[i].netif, &arp_table[i].ipaddr);
189 arp_table[i].netif = NULL;
252 * @param netif netif related to this address (used for NETIF_HWADDRHINT)
400 * Send an IP packet on the network using netif->linkoutput
403 * @params netif the lwIP network interface on which to send the packet
410 etharp_send_ip(struct netif *netif, struct pbuf *p, struct eth_addr *src, struct eth_addr *dst)
414 LWIP_ASSERT("netif->hwaddr_len must be the same as ETHARP_HWADDR_LEN for etharp!",
415 (netif->hwaddr_len == ETHARP_HWADDR_LEN));
421 return netif->linkoutput(netif, p);
430 * @param netif netif related to this entry (used for NETIF_ADDRHINT)
443 update_arp_entry(struct netif *netif, ip_addr_t *ipaddr, struct eth_addr *ethaddr, u8_t flags)
446 LWIP_ASSERT("netif->hwaddr_len == ETHARP_HWADDR_LEN", netif->hwaddr_len == ETHARP_HWADDR_LEN);
453 ip_addr_isbroadcast(ipaddr, netif) ||
477 arp_table[i].netif = netif;
480 snmp_insert_arpidx_tree(netif, &arp_table[i].ipaddr);
505 etharp_send_ip(netif, p, (struct eth_addr*)(netif->hwaddr), ethaddr);
524 struct netif *netif;
530 netif = ip_route(ipaddr);
531 if (netif == NULL) {
535 return update_arp_entry(netif, ipaddr, ethaddr, ETHARP_FLAG_TRY_HARD | ETHARP_FLAG_STATIC_ENTRY);
576 * @param netif points to interface index
583 etharp_find_addr(struct netif *netif, ip_addr_t *ipaddr,
591 LWIP_UNUSED_ARG(netif);
611 * @param netif The lwIP network interface on which the IP packet pbuf arrived.
612 * @param p The IP packet that arrived on netif.
619 etharp_ip_input(struct netif *netif, struct pbuf *p)
624 LWIP_ERROR("netif != NULL", (netif != NULL), return;);
639 if (!ip_addr_netcmp(&iphdr_src, &(netif->ip_addr), &(netif->netmask))) {
648 update_arp_entry(netif, &iphdr_src, &(ethhdr->src), ETHARP_FLAG_FIND_ONLY);
659 * @param netif The lwIP network interface on which the ARP packet pbuf arrived.
660 * @param ethaddr Ethernet address of netif.
661 * @param p The ARP packet that arrived on netif. Is freed by this function.
668 etharp_arp_input(struct netif *netif, struct eth_addr *ethaddr, struct pbuf *p)
679 LWIP_ERROR("netif != NULL", (netif != NULL), return;);
720 autoip_arp_reply(netif, hdr);
729 if (ip_addr_isany(&netif->ip_addr)) {
733 for_us = (u8_t)ip_addr_cmp(&dipaddr, &(netif->ip_addr));
741 update_arp_entry(netif, &sipaddr, &(hdr->shwaddr),
763 IPADDR2_COPY(&hdr->sipaddr, &netif->ip_addr);
765 LWIP_ASSERT("netif->hwaddr_len must be the same as ETHARP_HWADDR_LEN for etharp!",
766 (netif->hwaddr_len == ETHARP_HWADDR_LEN));
771 ethdst_hwaddr = ip_addr_islinklocal(&netif->ip_addr) ? (u8_t*)(ethbroadcast.addr) : hdr->shwaddr.addr;
787 netif->linkoutput(netif, p);
789 } else if (ip_addr_isany(&netif->ip_addr)) {
790 /* { for_us == 0 and netif->ip_addr.addr == 0 } */
794 /* { for_us == 0 and netif->ip_addr.addr != 0 } */
806 dhcp_arp_reply(netif, &sipaddr);
828 * @param netif The lwIP network interface which the IP packet will be sent on.
837 etharp_output(struct netif *netif, struct pbuf *q, ip_addr_t *ipaddr)
856 if (ip_addr_isbroadcast(ipaddr, netif)) {
873 if (!ip_addr_netcmp(ipaddr, &(netif->ip_addr), &(netif->netmask)) &&
886 if (!ip_addr_isany(&netif->gw)) {
888 ipaddr = &(netif->gw);
897 if (netif->addr_hint != NULL) {
899 u8_t etharp_cached_entry = *(netif->addr_hint);
906 return etharp_send_ip(netif, q, (struct eth_addr*)(netif->hwaddr),
914 return etharp_query(netif, ipaddr, q);
920 return etharp_send_ip(netif, q, (struct eth_addr*)(netif->hwaddr), dest);
939 * @param netif The lwIP network interface on which ipaddr
957 etharp_query(struct netif *netif, ip_addr_t *ipaddr, struct pbuf *q)
959 struct eth_addr * srcaddr = (struct eth_addr *)netif->hwaddr;
964 if (ip_addr_isbroadcast(ipaddr, netif) ||
997 result = etharp_request(netif, ipaddr);
1014 ETHARP_SET_HINT(netif, i);
1016 result = etharp_send_ip(netif, q, srcaddr, &(arp_table[i].ethaddr));
1100 * @param netif the lwip network interface on which to send the ARP packet
1116 etharp_raw(struct netif *netif, const struct eth_addr *ethsrc_addr,
1147 LWIP_ASSERT("netif->hwaddr_len must be the same as ETHARP_HWADDR_LEN for etharp!",
1148 (netif->hwaddr_len == ETHARP_HWADDR_LEN));
1178 result = netif->linkoutput(netif, p);
1191 * @param netif the lwip network interface on which to send the request
1198 etharp_request(struct netif *netif, ip_addr_t *ipaddr)
1201 return etharp_raw(netif, (struct eth_addr *)netif->hwaddr, &ethbroadcast,
1202 (struct eth_addr *)netif->hwaddr, &netif->ip_addr, &ethzero,
1213 * @param netif the network interface on which the packet was received
1216 ethernet_input(struct pbuf *p, struct netif *netif)
1262 netif = LWIP_ARP_FILTER_NETIF_FN(p, netif, htons(type));
1269 if (!(netif->flags & NETIF_FLAG_ETHARP)) {
1274 etharp_ip_input(netif, p);
1282 ip_input(p, netif);
1287 if (!(netif->flags & NETIF_FLAG_ETHARP)) {
1291 etharp_arp_input(netif, (struct eth_addr*)(netif->hwaddr), p);
1296 pppoe_disc_input(netif, p);
1300 pppoe_data_input(netif, p);