448 |
*/ |
*/ |
449 |
/*-----------------------------------------------------------------------------------*/ |
/*-----------------------------------------------------------------------------------*/ |
450 |
err_t |
err_t |
451 |
ip_output_if (struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, |
ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, |
452 |
u8_t ttl, |
u8_t ttl, u8_t tos, |
453 |
u8_t proto, struct netif *netif) |
u8_t proto, struct netif *netif) |
454 |
{ |
{ |
455 |
static struct ip_hdr *iphdr; |
static struct ip_hdr *iphdr; |
475 |
|
|
476 |
ip_addr_set(&(iphdr->dest), dest); |
ip_addr_set(&(iphdr->dest), dest); |
477 |
|
|
478 |
IPH_VHLTOS_SET(iphdr, 4, IP_HLEN / 4, 0); |
IPH_VHLTOS_SET(iphdr, 4, IP_HLEN / 4, tos); |
479 |
IPH_LEN_SET(iphdr, htons(p->tot_len)); |
IPH_LEN_SET(iphdr, htons(p->tot_len)); |
480 |
IPH_OFFSET_SET(iphdr, htons(IP_DF)); |
IPH_OFFSET_SET(iphdr, htons(IP_DF)); |
481 |
IPH_ID_SET(iphdr, htons(ip_id)); |
IPH_ID_SET(iphdr, htons(ip_id)); |
521 |
/*-----------------------------------------------------------------------------------*/ |
/*-----------------------------------------------------------------------------------*/ |
522 |
err_t |
err_t |
523 |
ip_output(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, |
ip_output(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, |
524 |
u8_t ttl, u8_t proto) |
u8_t ttl, u8_t tos, u8_t proto) |
525 |
{ |
{ |
526 |
struct netif *netif; |
struct netif *netif; |
527 |
|
|
535 |
return ERR_RTE; |
return ERR_RTE; |
536 |
} |
} |
537 |
|
|
538 |
return ip_output_if (p, src, dest, ttl, proto, netif); |
return ip_output_if(p, src, dest, ttl, tos, proto, netif); |
539 |
} |
} |
540 |
/*-----------------------------------------------------------------------------------*/ |
/*-----------------------------------------------------------------------------------*/ |
541 |
#if IP_DEBUG |
#if IP_DEBUG |