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

Function ng_ppp_comp_recv

freebsd/netgraph/ng_ppp.c:1151–1183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1149}
1150
1151static int
1152ng_ppp_comp_recv(node_p node, item_p item, uint16_t proto, uint16_t linkNum)
1153{
1154 const priv_p priv = NG_NODE_PRIVATE(node);
1155
1156 if (proto < 0x4000 &&
1157 ((proto == PROT_COMPD && priv->conf.enableDecompression) ||
1158 priv->conf.enableDecompression == NG_PPP_DECOMPRESS_FULL) &&
1159 priv->hooks[HOOK_INDEX_DECOMPRESS] != NULL) {
1160 int error;
1161
1162 if (priv->conf.enableDecompression == NG_PPP_DECOMPRESS_FULL) {
1163 struct mbuf *m;
1164 NGI_GET_M(item, m);
1165 if ((m = ng_ppp_addproto(m, proto, 0)) == NULL) {
1166 NG_FREE_ITEM(item);
1167 return (EIO);
1168 }
1169 NGI_M(item) = m;
1170 }
1171
1172 /* Send packet out hook. */
1173 NG_FWD_ITEM_HOOK(error, item,
1174 priv->hooks[HOOK_INDEX_DECOMPRESS]);
1175 return (error);
1176 } else if (proto == PROT_COMPD) {
1177 /* Disabled protos MUST be silently discarded, but
1178 * unsupported MUST not. Let user-level decide this. */
1179 return (ng_ppp_bypass(node, item, proto, linkNum));
1180 }
1181
1182 return (ng_ppp_hcomp_recv(node, item, proto, linkNum));
1183}
1184
1185/*
1186 * Receive data on a hook decompress.

Callers 2

ng_ppp_crypt_recvFunction · 0.85
ng_ppp_rcvdata_decryptFunction · 0.85

Calls 3

ng_ppp_addprotoFunction · 0.85
ng_ppp_bypassFunction · 0.85
ng_ppp_hcomp_recvFunction · 0.85

Tested by

no test coverage detected