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

Function ng_l2tp_seq_set

freebsd/netgraph/ng_l2tp.c:1213–1233  ·  view source on GitHub ↗

* Set sequence number state as given from user. */

Source from the content-addressed store, hash-verified

1211 * Set sequence number state as given from user.
1212 */
1213static int
1214ng_l2tp_seq_set(priv_p priv, const struct ng_l2tp_seq_config *conf)
1215{
1216 struct l2tp_seq *const seq = &priv->seq;
1217
1218 /* If node is enabled, deny update to sequence numbers. */
1219 if (priv->conf.enabled)
1220 return (EBUSY);
1221
1222 /* We only can handle the simple cases. */
1223 if (conf->xack != conf->nr || conf->ns != conf->rack)
1224 return (EINVAL);
1225
1226 /* Set ns,nr,rack,xack parameters. */
1227 seq->ns = conf->ns;
1228 seq->nr = conf->nr;
1229 seq->rack = conf->rack;
1230 seq->xack = conf->xack;
1231
1232 return (0);
1233}
1234
1235/*
1236 * Adjust sequence number state accordingly after reconfiguration.

Callers 1

ng_l2tp_rcvmsgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected