Lines Matching defs:pd
171 int pd;
348 pppRecvWakeup(int pd)
350 PPPDEBUG(LOG_DEBUG, ("pppRecvWakeup: unit %d\n", pd));
351 if (pppControl[pd].openFlag != 0) {
352 sio_read_abort(pppControl[pd].fd);
359 pppLinkTerminated(int pd)
361 PPPDEBUG(LOG_DEBUG, ("pppLinkTerminated: unit %d\n", pd));
364 if (pppControl[pd].ethif) {
365 pppoe_disconnect(pppControl[pd].pppoe_sc);
372 pppRecvWakeup(pd);
374 pc = &pppControl[pd];
376 PPPDEBUG(LOG_DEBUG, ("pppLinkTerminated: unit %d: linkStatusCB=%p errCode=%d\n", pd, pc->linkStatusCB, pc->errCode));
388 pppLinkDown(int pd)
390 PPPDEBUG(LOG_DEBUG, ("pppLinkDown: unit %d\n", pd));
393 if (pppControl[pd].ethif) {
394 pppoe_disconnect(pppControl[pd].pppoe_sc);
399 pppRecvWakeup(pd);
406 pppStart(int pd)
408 PPPDEBUG(LOG_DEBUG, ("pppStart: unit %d\n", pd));
409 lcp_lowerup(pd);
410 lcp_open(pd); /* Start protocol */
416 pppStop(int pd)
418 PPPDEBUG(LOG_DEBUG, ("pppStop: unit %d\n", pd));
419 lcp_close(pd, "User request");
424 pppHup(int pd)
426 PPPDEBUG(LOG_DEBUG, ("pppHupCB: unit %d\n", pd));
427 lcp_lowerdown(pd);
428 link_terminated(pd);
540 int pd;
549 for (pd = 0; pd < NUM_PPP && pppControl[pd].openFlag != 0; pd++);
551 if (pd >= NUM_PPP) {
552 pd = PPPERR_OPEN;
554 pc = &pppControl[pd];
559 pc->rx.pd = pd;
582 PPPDEBUG(LOG_INFO, ("pppOverSerialOpen: unit %d: Connecting\n", pd));
583 pppStart(pd);
589 return pd;
594 static void pppOverEthernetLinkStatusCB(int pd, int up);
597 pppOverEthernetClose(int pd)
599 PPPControl* pc = &pppControl[pd];
602 lcp_close(pd, NULL);
611 int pd;
623 for (pd = 0; pd < NUM_PPP && pppControl[pd].openFlag != 0; pd++);
624 if (pd >= NUM_PPP) {
625 pd = PPPERR_OPEN;
627 pc = &pppControl[pd];
635 lcp_wantoptions[pd].mru = PPPOE_MAXMTU;
636 lcp_wantoptions[pd].neg_asyncmap = 0;
637 lcp_wantoptions[pd].neg_pcompression = 0;
638 lcp_wantoptions[pd].neg_accompression = 0;
640 lcp_allowoptions[pd].mru = PPPOE_MAXMTU;
641 lcp_allowoptions[pd].neg_asyncmap = 0;
642 lcp_allowoptions[pd].neg_pcompression = 0;
643 lcp_allowoptions[pd].neg_accompression = 0;
645 if(pppoe_create(ethif, pd, pppOverEthernetLinkStatusCB, &pc->pppoe_sc) != ERR_OK) {
653 return pd;
662 pppClose(int pd)
664 PPPControl *pc = &pppControl[pd];
672 PPPDEBUG(LOG_DEBUG, ("pppClose: unit %d kill_link -> pppStop\n", pd));
675 pppStop(pd);
680 PPPDEBUG(LOG_DEBUG, ("pppClose: unit %d kill_link -> pppStop\n", pd));
683 pppStop(pd);
685 pppRecvWakeup(pd);
695 pppSigHUP(int pd)
697 PPPDEBUG(LOG_DEBUG, ("pppSigHUP: unit %d sig_hup -> pppHupCB\n", pd));
698 pppHup(pd);
766 pppifOutputOverEthernet(int pd, struct pbuf *p)
768 PPPControl *pc = &pppControl[pd];
812 int pd = (int)(size_t)netif->state;
813 PPPControl *pc = &pppControl[pd];
826 if (pd < 0 || pd >= NUM_PPP || !pc->openFlag || !pb) {
828 pd, PPP_IP, pb));
836 if (lcp_phase[pd] == PHASE_DEAD) {
837 PPPDEBUG(LOG_ERR, ("pppifOutput[%d]: link not up\n", pd));
846 return pppifOutputOverEthernet(pd, pb);
854 PPPDEBUG(LOG_WARNING, ("pppifOutput[%d]: first alloc fail\n", pd));
879 PPPDEBUG(LOG_WARNING, ("pppifOutput[%d]: bad IP packet\n", pd));
941 pd, protocol));
950 PPPDEBUG(LOG_INFO, ("pppifOutput[%d]: proto=0x%"X16_F"\n", pd, protocol));
961 pppIOCtl(int pd, int cmd, void *arg)
963 PPPControl *pc = &pppControl[pd];
966 if (pd < 0 || pd >= NUM_PPP) {
1013 pppMTU(int pd)
1015 PPPControl *pc = &pppControl[pd];
1019 if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) {
1030 pppWriteOverEthernet(int pd, const u_char *s, int n)
1032 PPPControl *pc = &pppControl[pd];
1073 pppWrite(int pd, const u_char *s, int n)
1075 PPPControl *pc = &pppControl[pd];
1084 return pppWriteOverEthernet(pd, s, n);
1129 ("pppWrite[%d]: Alloc err - dropping pbuf len=%d\n", pd, headMB->len));
1130 /*"pppWrite[%d]: Alloc err - dropping %d:%.*H", pd, headMB->len, LWIP_MIN(headMB->len * 2, 40), headMB->payload)); */
1138 PPPDEBUG(LOG_INFO, ("pppWrite[%d]: len=%d\n", pd, headMB->len));
1139 /* "pppWrite[%d]: %d:%.*H", pd, headMB->len, LWIP_MIN(headMB->len * 2, 40), headMB->payload)); */
1299 sifvjcomp(int pd, int vjcomp, u8_t cidcomp, u8_t maxcid)
1302 PPPControl *pc = &pppControl[pd];
1310 LWIP_UNUSED_ARG(pd);
1342 sifup(int pd)
1344 PPPControl *pc = &pppControl[pd];
1347 if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) {
1349 PPPDEBUG(LOG_WARNING, ("sifup[%d]: bad parms\n", pd));
1353 &pc->addrs.his_ipaddr, (void *)(size_t)pd, pppifNetifInit, ip_input)) {
1358 PPPDEBUG(LOG_DEBUG, ("sifup: unit %d: linkStatusCB=%p errCode=%d\n", pd, pc->linkStatusCB, pc->errCode));
1364 PPPDEBUG(LOG_ERR, ("sifup[%d]: netif_add failed\n", pd));
1387 sifdown(int pd)
1389 PPPControl *pc = &pppControl[pd];
1392 if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) {
1394 PPPDEBUG(LOG_WARNING, ("sifdown[%d]: bad parms\n", pd));
1400 PPPDEBUG(LOG_DEBUG, ("sifdown: unit %d: linkStatusCB=%p errCode=%d\n", pd, pc->linkStatusCB, pc->errCode));
1410 * @param pd Interface unit ???
1418 sifaddr( int pd, u32_t o, u32_t h, u32_t m, u32_t ns1, u32_t ns2)
1420 PPPControl *pc = &pppControl[pd];
1423 if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) {
1425 PPPDEBUG(LOG_WARNING, ("sifup[%d]: bad parms\n", pd));
1439 * @param pd Interface unit ???
1444 cifaddr( int pd, u32_t o, u32_t h)
1446 PPPControl *pc = &pppControl[pd];
1451 if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) {
1453 PPPDEBUG(LOG_WARNING, ("sifup[%d]: bad parms\n", pd));
1468 sifdefaultroute(int pd, u32_t l, u32_t g)
1470 PPPControl *pc = &pppControl[pd];
1476 if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) {
1478 PPPDEBUG(LOG_WARNING, ("sifup[%d]: bad parms\n", pd));
1492 cifdefaultroute(int pd, u32_t l, u32_t g)
1494 PPPControl *pc = &pppControl[pd];
1500 if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) {
1502 PPPDEBUG(LOG_WARNING, ("sifup[%d]: bad parms\n", pd));
1523 while (lcp_phase[pcrx->pd] != PHASE_DEAD) {
1538 pppOverEthernetInitFailed(int pd)
1542 pppHup(pd);
1543 pppStop(pd);
1545 pc = &pppControl[pd];
1555 pppOverEthernetLinkStatusCB(int pd, int up)
1558 PPPDEBUG(LOG_INFO, ("pppOverEthernetLinkStatusCB: unit %d: Connecting\n", pd));
1559 pppStart(pd);
1561 pppOverEthernetInitFailed(pd);
1607 int pd;
1609 pd = ((struct pppInputHeader *)nb->payload)->unit;
1618 snmp_inc_ifinucastpkts(&pppControl[pd].netif);
1619 snmp_add_ifinoctets(&pppControl[pd].netif, nb->tot_len);
1626 if((lcp_phase[pd] <= PHASE_AUTHENTICATE) && (protocol != PPP_LCP)) {
1628 (lcp_phase[pd] != PHASE_AUTHENTICATE)) {
1629 PPPDEBUG(LOG_INFO, ("pppInput: discarding proto 0x%"X16_F" in phase %d\n", protocol, lcp_phase[pd]));
1637 PPPDEBUG(LOG_INFO, ("pppInput[%d]: vj_comp in pbuf len=%d\n", pd, nb->len));
1642 if ((vj_uncompress_tcp(&nb, &pppControl[pd].vjComp) >= 0) && (pppControl[pd].netif.input)) {
1643 pppControl[pd].netif.input(nb, &pppControl[pd].netif);
1647 PPPDEBUG(LOG_WARNING, ("pppInput[%d]: Dropping VJ compressed\n", pd));
1650 PPPDEBUG(LOG_INFO, ("pppInput[%d]: drop VJ Comp in %d:%s\n", pd, nb->len, nb->payload));
1656 PPPDEBUG(LOG_INFO, ("pppInput[%d]: vj_un in pbuf len=%d\n", pd, nb->len));
1661 if ((vj_uncompress_uncomp(nb, &pppControl[pd].vjComp) >= 0) && pppControl[pd].netif.input) {
1662 pppControl[pd].netif.input(nb, &pppControl[pd].netif);
1666 PPPDEBUG(LOG_WARNING, ("pppInput[%d]: Dropping VJ uncompressed\n", pd));
1671 pd, nb->len, LWIP_MIN(nb->len * 2, 40), nb->payload));
1676 PPPDEBUG(LOG_INFO, ("pppInput[%d]: ip in pbuf len=%d\n", pd, nb->len));
1677 if (pppControl[pd].netif.input) {
1678 pppControl[pd].netif.input(nb, &pppControl[pd].netif);
1692 PPPDEBUG(LOG_INFO, ("pppInput[%d]: %s len=%d\n", pd, protp->name, nb->len));
1694 (*protp->input)(pd, nb->payload, nb->len);
1695 PPPDEBUG(LOG_DETAIL, ("pppInput[%d]: packet processed\n", pd));
1701 PPPDEBUG(LOG_INFO, ("pppInput[%d]: rejecting unsupported proto 0x%"X16_F" len=%d\n", pd, protocol, nb->len));
1710 lcp_sprotrej(pd, nb->payload, nb->len);
1717 snmp_inc_ifindiscards(&pppControl[pd].netif);
1755 vj_uncompress_err(&pppControl[pcrx->pd].vjComp);
1759 snmp_inc_ifindiscards(&pppControl[pcrx->pd].netif);
1766 * @param pd PPP descriptor index, returned by pppOpen()
1771 pppos_input(int pd, u_char* data, int len)
1773 pppInProc(&pppControl[pd].rx, data, len);
1788 PPPDEBUG(LOG_DEBUG, ("pppInProc[%d]: got %d bytes\n", pcrx->pd, l));
1813 pcrx->pd, pcrx->inState));
1820 pcrx->pd, pcrx->inFCS, pcrx->inProtocol));
1851 PPPDEBUG(LOG_ERR, ("pppInProc[%d]: tcpip_callback() failed, dropping packet\n", pcrx->pd));
1854 snmp_inc_ifindiscards(&pppControl[pcrx->pd].netif);
1869 ("pppInProc[%d]: Dropping ACCM char <%d>\n", pcrx->pd, curChar));
1910 ("pppInProc[%d]: Invalid control <%d>\n", pcrx->pd, curChar));
1946 PPPDEBUG(LOG_ERR, ("pppInProc[%d]: NO FREE MBUFS!\n", pcrx->pd));
1955 pih->unit = pcrx->pd;
1980 pppInProcOverEthernet(int pd, struct pbuf *pb)
2000 pih->unit = pd;
2009 snmp_inc_ifindiscards(&pppControl[pd].netif);
2018 * @param pd The PPP descriptor returned by pppOpen()
2024 ppp_set_netif_statuscallback(int pd, netif_status_callback_fn status_callback)
2026 netif_set_status_callback(&pppControl[pd].netif, status_callback);
2033 * @param pd The PPP descriptor returned by pppOpen()
2039 ppp_set_netif_linkcallback(int pd, netif_status_callback_fn link_callback)
2041 netif_set_link_callback(&pppControl[pd].netif, link_callback);