MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ng_ppp_rcvdata_bypass

Function ng_ppp_rcvdata_bypass

freebsd/netgraph/ng_ppp.c:862–888  ·  view source on GitHub ↗

* Receive data on a hook bypass */

Source from the content-addressed store, hash-verified

860 * Receive data on a hook bypass
861 */
862static int
863ng_ppp_rcvdata_bypass(hook_p hook, item_p item)
864{
865 uint16_t linkNum;
866 uint16_t proto;
867 struct mbuf *m;
868
869 NGI_GET_M(item, m);
870 if (m->m_pkthdr.len < 4) {
871 NG_FREE_ITEM(item);
872 return (EINVAL);
873 }
874 if (m->m_len < 4 && (m = m_pullup(m, 4)) == NULL) {
875 NG_FREE_ITEM(item);
876 return (ENOBUFS);
877 }
878 linkNum = be16dec(mtod(m, uint8_t *));
879 proto = be16dec(mtod(m, uint8_t *) + 2);
880 m_adj(m, 4);
881 NGI_M(item) = m;
882
883 if (linkNum == NG_PPP_BUNDLE_LINKNUM)
884 return (ng_ppp_hcomp_xmit(NG_HOOK_NODE(hook), item, proto));
885 else
886 return (ng_ppp_link_xmit(NG_HOOK_NODE(hook), item, proto,
887 linkNum, 0));
888}
889
890static int
891ng_ppp_bypass(node_p node, item_p item, uint16_t proto, uint16_t linkNum)

Callers

nothing calls this directly

Calls 5

m_pullupFunction · 0.85
be16decFunction · 0.85
m_adjFunction · 0.85
ng_ppp_hcomp_xmitFunction · 0.85
ng_ppp_link_xmitFunction · 0.85

Tested by

no test coverage detected