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

Function ipsec_setspidx_inpcb

freebsd/netipsec/ipsec_pcb.c:128–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128void
129ipsec_setspidx_inpcb(struct inpcb *inp, struct secpolicyindex *spidx,
130 u_int dir)
131{
132
133 ipsec_setsockaddrs_inpcb(inp, &spidx->src, &spidx->dst, dir);
134#ifdef INET6
135 if (inp->inp_vflag & INP_IPV6) {
136 spidx->prefs = sizeof(struct in6_addr) << 3;
137 spidx->prefd = sizeof(struct in6_addr) << 3;
138 }
139#endif
140#ifdef INET
141 if (inp->inp_vflag & INP_IPV4) {
142 spidx->prefs = sizeof(struct in_addr) << 3;
143 spidx->prefd = sizeof(struct in_addr) << 3;
144 }
145#endif
146 spidx->ul_proto = IPPROTO_TCP; /* XXX: currently only TCP uses this */
147 spidx->dir = dir;
148 KEYDBG(IPSEC_DUMP,
149 printf("%s: ", __func__); kdebug_secpolicyindex(spidx, NULL));
150}
151
152/* Initialize PCB policy. */
153int

Callers 2

ipsec_hdrsiz_inpcbFunction · 0.85
ipsec_copy_pcbpolicyFunction · 0.85

Calls 3

ipsec_setsockaddrs_inpcbFunction · 0.85
kdebug_secpolicyindexFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected