Lines Matching refs:netif
47 #include "lwip/netif.h"
76 * netif is down.
100 struct netif *current_netif;
121 * @return the netif on which to send to reach dest
123 struct netif *
126 struct netif *netif;
129 netif = LWIP_HOOK_IP4_ROUTE(dest);
130 if (netif != NULL) {
131 return netif;
136 for (netif = netif_list; netif != NULL; netif = netif->next) {
138 if (netif_is_up(netif)) {
139 if (ip_addr_netcmp(dest, &(netif->ip_addr), &(netif->netmask))) {
140 /* return netif on which to forward IP packet */
141 return netif;
152 /* no matching netif found, use default netif */
199 * @param inp the netif on which this packet was received
202 ip_forward(struct pbuf *p, struct ip_hdr *iphdr, struct netif *inp)
204 struct netif *netif;
221 netif = ip_route(¤t_iphdr_dest);
222 if (netif == NULL) {
232 if (netif == inp) {
269 if (netif->mtu && (p->tot_len > netif->mtu)) {
272 ip_frag(p, netif, ip_current_dest_addr());
283 netif->output(netif, p, ¤t_iphdr_dest);
300 * @param inp the netif on which this packet was received
305 ip_input(struct pbuf *p, struct netif *inp)
308 struct netif *netif;
379 /* Trim pbuf. This should have been done at the netif layer,
391 netif = inp;
393 netif = NULL;
402 netif = inp;
404 LWIP_DEBUGF(IP_DEBUG, ("ip_input: iphdr->dest 0x%"X32_F" netif->ip_addr 0x%"X32_F" (0x%"X32_F", 0x%"X32_F", 0x%"X32_F")\n",
405 ip4_addr_get_u32(&iphdr->dest), ip4_addr_get_u32(&netif->ip_addr),
406 ip4_addr_get_u32(&iphdr->dest) & ip4_addr_get_u32(&netif->netmask),
407 ip4_addr_get_u32(&netif->ip_addr) & ip4_addr_get_u32(&netif->netmask),
408 ip4_addr_get_u32(&iphdr->dest) & ~ip4_addr_get_u32(&netif->netmask)));
411 if ((netif_is_up(netif)) && (!ip_addr_isany(&(netif->ip_addr)))) {
413 if (ip_addr_cmp(¤t_iphdr_dest, &(netif->ip_addr)) ||
415 ip_addr_isbroadcast(¤t_iphdr_dest, netif)) {
417 netif->name[0], netif->name[1]));
423 the netif's address (RFC3927 ch. 1.9) */
424 if ((netif->autoip != NULL) &&
425 ip_addr_cmp(¤t_iphdr_dest, &(netif->autoip->llipaddr))) {
427 netif->name[0], netif->name[1]));
435 netif = netif_list;
437 netif = netif->next;
439 if (netif == inp) {
440 netif = netif->next;
442 } while(netif != NULL);
450 * If you want to accept private broadcast communication while a netif is down,
455 if (netif == NULL) {
463 netif = inp;
489 if (netif == NULL) {
627 * IP address of the netif used to send is used as source address)
632 * @param netif the netif on which to send this packet
635 * returns errors returned by netif->output
643 u8_t proto, struct netif *netif)
646 return ip_output_if_opt(p, src, dest, ttl, tos, proto, netif, NULL, 0);
656 u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options,
746 ip_addr_copy(iphdr->src, netif->ip_addr);
774 LWIP_DEBUGF(IP_DEBUG, ("ip_output_if: %c%c%"U16_F"\n", netif->name[0], netif->name[1], netif->num));
778 if (ip_addr_cmp(dest, &netif->ip_addr)) {
781 return netif_loop_output(netif, p, dest);
785 netif_loop_output(netif, p, dest);
791 if (netif->mtu && (p->tot_len > netif->mtu)) {
792 return ip_frag(p, netif, dest);
796 LWIP_DEBUGF(IP_DEBUG, ("netif->output()"));
797 return netif->output(netif, p, dest);
808 * IP address of the netif used to send is used as source address)
821 struct netif *netif;
827 if ((netif = ip_route(dest)) == NULL) {
834 return ip_output_if(p, src, dest, ttl, tos, proto, netif);
838 /** Like ip_output, but takes and addr_hint pointer that is passed on to netif->addr_hint
845 * IP address of the netif used to send is used as source address)
850 * @param addr_hint address hint pointer set to netif->addr_hint before
860 struct netif *netif;
867 if ((netif = ip_route(dest)) == NULL) {
874 NETIF_SET_HWADDRHINT(netif, addr_hint);
875 err = ip_output_if(p, src, dest, ttl, tos, proto, netif);
876 NETIF_SET_HWADDRHINT(netif, NULL);