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

Function ng_ppp_rcvdata_compress

freebsd/netgraph/ng_ppp.c:1117–1149  ·  view source on GitHub ↗

* Receive data on a hook compress. */

Source from the content-addressed store, hash-verified

1115 * Receive data on a hook compress.
1116 */
1117static int
1118ng_ppp_rcvdata_compress(hook_p hook, item_p item)
1119{
1120 const node_p node = NG_HOOK_NODE(hook);
1121 const priv_p priv = NG_NODE_PRIVATE(node);
1122 uint16_t proto;
1123
1124 switch (priv->conf.enableCompression) {
1125 case NG_PPP_COMPRESS_NONE:
1126 NG_FREE_ITEM(item);
1127 return (ENXIO);
1128 case NG_PPP_COMPRESS_FULL:
1129 {
1130 struct mbuf *m;
1131
1132 NGI_GET_M(item, m);
1133 if ((m = ng_ppp_cutproto(m, &proto)) == NULL) {
1134 NG_FREE_ITEM(item);
1135 return (EIO);
1136 }
1137 NGI_M(item) = m;
1138 if (!PROT_VALID(proto)) {
1139 NG_FREE_ITEM(item);
1140 return (EIO);
1141 }
1142 }
1143 break;
1144 default:
1145 proto = PROT_COMPD;
1146 break;
1147 }
1148 return (ng_ppp_crypt_xmit(node, item, proto));
1149}
1150
1151static int
1152ng_ppp_comp_recv(node_p node, item_p item, uint16_t proto, uint16_t linkNum)

Callers

nothing calls this directly

Calls 2

ng_ppp_cutprotoFunction · 0.85
ng_ppp_crypt_xmitFunction · 0.85

Tested by

no test coverage detected