mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-11 01:53:48 +08:00
Even more pbuf_header -> pbuf_add/remove_header replacements (also in strings)
This commit is contained in:
@@ -257,7 +257,7 @@ mppe_compress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb, u16_t proto
|
||||
}
|
||||
|
||||
/* Reveal MPPE header */
|
||||
pbuf_header(np, (s16_t)MPPE_OVHD);
|
||||
pbuf_add_header(np, MPPE_OVHD);
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
@@ -957,7 +957,7 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) {
|
||||
#endif /* PPP_PROTOCOLNAME */
|
||||
ppp_warn("Unsupported protocol 0x%x received", protocol);
|
||||
#endif /* PPP_DEBUG */
|
||||
pbuf_header(pb, (s16_t)sizeof(protocol));
|
||||
pbuf_add_header(pb, sizeof(protocol));
|
||||
lcp_sprotrej(pcb, (u8_t*)pb->payload, pb->len);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -662,7 +662,7 @@ pppoe_data_input(struct netif *netif, struct pbuf *pb)
|
||||
#endif
|
||||
if (pbuf_remove_header(pb, sizeof(struct eth_hdr)) != 0) {
|
||||
/* bail out */
|
||||
PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_header failed\n"));
|
||||
PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_remove_header failed\n"));
|
||||
LINK_STATS_INC(link.lenerr);
|
||||
goto drop;
|
||||
}
|
||||
@@ -695,7 +695,7 @@ pppoe_data_input(struct netif *netif, struct pbuf *pb)
|
||||
|
||||
if (pbuf_remove_header(pb, PPPOE_HEADERLEN) != 0) {
|
||||
/* bail out */
|
||||
PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_header PPPOE_HEADERLEN failed\n"));
|
||||
PPPDEBUG(LOG_ERR, ("pppoe_data_input: pbuf_remove_header PPPOE_HEADERLEN failed\n"));
|
||||
LINK_STATS_INC(link.lenerr);
|
||||
goto drop;
|
||||
}
|
||||
@@ -724,7 +724,7 @@ pppoe_output(struct pppoe_softc *sc, struct pbuf *pb)
|
||||
err_t res;
|
||||
|
||||
/* make room for Ethernet header - should not fail */
|
||||
if (pbuf_header(pb, (s16_t)(sizeof(struct eth_hdr))) != 0) {
|
||||
if (pbuf_add_header(pb, sizeof(struct eth_hdr)) != 0) {
|
||||
/* bail out */
|
||||
PPPDEBUG(LOG_ERR, ("pppoe: %c%c%"U16_F": pppoe_output: could not allocate room for Ethernet header\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num));
|
||||
LINK_STATS_INC(link.lenerr);
|
||||
@@ -1043,7 +1043,7 @@ pppoe_send_padt(struct netif *outgoing_if, u_int session, const u8_t *dest)
|
||||
}
|
||||
LWIP_ASSERT("pb->tot_len == pb->len", pb->tot_len == pb->len);
|
||||
|
||||
pbuf_header(pb, (s16_t)sizeof(struct eth_hdr));
|
||||
pbuf_add_header(pb, sizeof(struct eth_hdr));
|
||||
ethhdr = (struct eth_hdr *)pb->payload;
|
||||
ethhdr->type = PP_HTONS(ETHTYPE_PPPOEDISC);
|
||||
MEMCPY(ðhdr->dest.addr, dest, sizeof(ethhdr->dest.addr));
|
||||
@@ -1137,7 +1137,7 @@ pppoe_xmit(struct pppoe_softc *sc, struct pbuf *pb)
|
||||
len = pb->tot_len;
|
||||
|
||||
/* make room for PPPoE header - should not fail */
|
||||
if (pbuf_header(pb, (s16_t)(PPPOE_HEADERLEN)) != 0) {
|
||||
if (pbuf_add_header(pb, PPPOE_HEADERLEN) != 0) {
|
||||
/* bail out */
|
||||
PPPDEBUG(LOG_ERR, ("pppoe: %c%c%"U16_F": pppoe_xmit: could not allocate room for PPPoE header\n", sc->sc_ethif->name[0], sc->sc_ethif->name[1], sc->sc_ethif->num));
|
||||
LINK_STATS_INC(link.lenerr);
|
||||
|
||||
@@ -1108,7 +1108,7 @@ static err_t pppol2tp_xmit(pppol2tp_pcb *l2tp, struct pbuf *pb) {
|
||||
u8_t *p;
|
||||
|
||||
/* make room for L2TP header - should not fail */
|
||||
if (pbuf_header(pb, (s16_t)PPPOL2TP_OUTPUT_DATA_HEADER_LEN) != 0) {
|
||||
if (pbuf_add_header(pb, PPPOL2TP_OUTPUT_DATA_HEADER_LEN) != 0) {
|
||||
/* bail out */
|
||||
PPPDEBUG(LOG_ERR, ("pppol2tp: pppol2tp_pcb: could not allocate room for L2TP header\n"));
|
||||
LINK_STATS_INC(link.lenerr);
|
||||
|
||||
@@ -705,7 +705,7 @@ static void pppos_input_callback(void *arg) {
|
||||
|
||||
ppp = ((struct pppos_input_header*)pb->payload)->ppp;
|
||||
if(pbuf_remove_header(pb, sizeof(struct pppos_input_header))) {
|
||||
LWIP_ASSERT("pbuf_header failed\n", 0);
|
||||
LWIP_ASSERT("pbuf_remove_header failed\n", 0);
|
||||
goto drop;
|
||||
}
|
||||
|
||||
|
||||
@@ -409,7 +409,7 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf **pb)
|
||||
hlen -= deltaS + 4;
|
||||
if (pbuf_remove_header(np, hlen)){
|
||||
/* Can we cope with this failing? Just assert for now */
|
||||
LWIP_ASSERT("pbuf_header failed\n", 0);
|
||||
LWIP_ASSERT("pbuf_remove_header failed\n", 0);
|
||||
}
|
||||
cp = (u8_t*)np->payload;
|
||||
*cp++ = (u8_t)(changes | NEW_C);
|
||||
@@ -418,7 +418,7 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf **pb)
|
||||
hlen -= deltaS + 3;
|
||||
if (pbuf_remove_header(np, hlen)) {
|
||||
/* Can we cope with this failing? Just assert for now */
|
||||
LWIP_ASSERT("pbuf_header failed\n", 0);
|
||||
LWIP_ASSERT("pbuf_remove_header failed\n", 0);
|
||||
}
|
||||
cp = (u8_t*)np->payload;
|
||||
*cp++ = (u8_t)changes;
|
||||
@@ -621,7 +621,7 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp)
|
||||
/* Remove the compressed header and prepend the uncompressed header. */
|
||||
if (pbuf_remove_header(n0, vjlen)) {
|
||||
/* Can we cope with this failing? Just assert for now */
|
||||
LWIP_ASSERT("pbuf_header failed\n", 0);
|
||||
LWIP_ASSERT("pbuf_remove_header failed\n", 0);
|
||||
goto bad;
|
||||
}
|
||||
|
||||
@@ -644,7 +644,7 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp)
|
||||
|
||||
if (pbuf_remove_header(np, cs->cs_hlen)) {
|
||||
/* Can we cope with this failing? Just assert for now */
|
||||
LWIP_ASSERT("pbuf_header failed\n", 0);
|
||||
LWIP_ASSERT("pbuf_remove_header failed\n", 0);
|
||||
goto bad;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user