Lines Matching refs:pb

285 pppoe_dispatch_disc_pkt(struct netif *netif, struct pbuf *pb)
303 pb = pppSingleBuf(pb);
308 if (pb->len < sizeof(*ethhdr)) {
311 ethhdr = (struct eth_hdr *)pb->payload;
321 if (pb->len - off < PPPOE_HEADERLEN) {
322 printf("pppoe: packet too short: %d\n", pb->len);
335 if (plen + off > pb->len) {
337 pb->len - off, plen);
340 if(pb->tot_len == pb->len) {
341 pb->tot_len = pb->len = (u16_t)off + plen; /* ignore trailing garbage */
346 while (off + sizeof(pt) <= pb->len) {
347 MEMCPY(&pt, (u8_t*)pb->payload + off, sizeof(pt));
350 if (off + sizeof(pt) + len > pb->len) {
366 hunique = (u8_t*)pb->payload + off + sizeof(pt);
369 sc = pppoe_find_softc_by_hunique((u8_t*)pb->payload + off + sizeof(pt), len, netif);
376 ac_cookie = (u8_t*)pb->payload + off + sizeof(pt);
396 strncpy(pppoe_error_tmp, (char*)pb->payload + off + sizeof(pt), error_len);
545 pbuf_free(pb);
561 pppoe_data_input(struct netif *netif, struct pbuf *pb)
571 MEMCPY(shost, ((struct eth_hdr *)pb->payload)->src.addr, sizeof(shost));
573 if (pbuf_header(pb, -(int)sizeof(struct eth_hdr)) != 0) {
580 pb = pppSingleBuf (pb);
582 if (pb->len <= PPPOE_HEADERLEN) {
583 printf("pppoe (data): dropping too short packet: %d bytes\n", pb->len);
587 if (pb->len < sizeof(*ph)) {
591 ph = (struct pppoehdr *)pb->payload;
613 if (pbuf_header(pb, -(int)(PPPOE_HEADERLEN)) != 0) {
622 pb->len, plen));
624 if (pb->len < plen) {
628 pppInProcOverEthernet(sc->sc_pd, pb);
633 pbuf_free(pb);
637 pppoe_output(struct pppoe_softc *sc, struct pbuf *pb)
644 pbuf_free(pb);
648 ethhdr = (struct eth_hdr *)pb->payload;
658 pb->tot_len));
660 res = sc->sc_ethif->linkoutput(sc->sc_ethif, pb);
662 pbuf_free(pb);
670 struct pbuf *pb;
697 pb = pbuf_alloc(PBUF_LINK, (u16_t)(sizeof(struct eth_hdr) + PPPOE_HEADERLEN + len), PBUF_RAM);
698 if (!pb) {
701 LWIP_ASSERT("pb->tot_len == pb->len", pb->tot_len == pb->len);
703 p = (u8_t*)pb->payload + sizeof (struct eth_hdr);
730 return pppoe_output(sc, pb);
891 struct pbuf *pb;
914 pb = pbuf_alloc(PBUF_LINK, (u16_t)(sizeof(struct eth_hdr) + PPPOE_HEADERLEN + len), PBUF_RAM);
915 if (!pb) {
918 LWIP_ASSERT("pb->tot_len == pb->len", pb->tot_len == pb->len);
919 p = (u8_t*)pb->payload + sizeof (struct eth_hdr);
942 return pppoe_output(sc, pb);
949 struct pbuf *pb;
954 pb = pbuf_alloc(PBUF_LINK, sizeof(struct eth_hdr) + PPPOE_HEADERLEN, PBUF_RAM);
955 if (!pb) {
958 LWIP_ASSERT("pb->tot_len == pb->len", pb->tot_len == pb->len);
960 ethhdr = (struct eth_hdr *)pb->payload;
968 res = outgoing_if->linkoutput(outgoing_if, pb);
970 pbuf_free(pb);
979 struct pbuf *pb;
993 pb = pbuf_alloc(PBUF_LINK, sizeof(struct eth_hdr) + PPPOE_HEADERLEN + len, PBUF_RAM);
994 if (!pb) {
997 LWIP_ASSERT("pb->tot_len == pb->len", pb->tot_len == pb->len);
998 p = (u8_t*)pb->payload + sizeof (struct eth_hdr);
1007 return pppoe_output(sc, pb);
1013 struct pbuf *pb;
1030 pb = pbuf_alloc(PBUF_LINK, sizeof(struct eth_hdr) + PPPOE_HEADERLEN + len, PBUF_RAM);
1031 if (!pb) {
1034 LWIP_ASSERT("pb->tot_len == pb->len", pb->tot_len == pb->len);
1035 p = (u8_t*)pb->payload + sizeof (struct eth_hdr);
1048 return pppoe_output(sc, pb);
1053 pppoe_xmit(struct pppoe_softc *sc, struct pbuf *pb)
1061 pbuf_free(pb);
1065 len = pb->tot_len;
1068 if (pbuf_header(pb, sizeof(struct eth_hdr) + PPPOE_HEADERLEN) != 0) {
1072 pbuf_free(pb);
1076 p = (u8_t*)pb->payload + sizeof(struct eth_hdr);
1079 return pppoe_output(sc, pb);