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

Function enc_clone_create

freebsd/net/if_enc.c:158–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158static int
159enc_clone_create(struct if_clone *ifc, int unit, caddr_t params)
160{
161 struct ifnet *ifp;
162 struct enc_softc *sc;
163
164 sc = malloc(sizeof(struct enc_softc), M_DEVBUF,
165 M_WAITOK | M_ZERO);
166 ifp = sc->sc_ifp = if_alloc(IFT_ENC);
167 if (ifp == NULL) {
168 free(sc, M_DEVBUF);
169 return (ENOSPC);
170 }
171 if (V_enc_sc != NULL) {
172 if_free(ifp);
173 free(sc, M_DEVBUF);
174 return (EEXIST);
175 }
176 V_enc_sc = sc;
177 if_initname(ifp, encname, unit);
178 ifp->if_mtu = ENCMTU;
179 ifp->if_ioctl = enc_ioctl;
180 ifp->if_output = enc_output;
181 ifp->if_softc = sc;
182 if_attach(ifp);
183 bpfattach(ifp, DLT_ENC, sizeof(struct enchdr));
184 return (0);
185}
186
187static int
188enc_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,

Callers

nothing calls this directly

Calls 7

mallocFunction · 0.85
if_allocFunction · 0.85
if_freeFunction · 0.85
if_initnameFunction · 0.85
if_attachFunction · 0.85
bpfattachFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected