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

Function me_clone_create

freebsd/net/if_me.c:189–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187 vnet_me_uninit, NULL);
188
189static int
190me_clone_create(struct if_clone *ifc, int unit, caddr_t params)
191{
192 struct me_softc *sc;
193
194 sc = malloc(sizeof(struct me_softc), M_IFME, M_WAITOK | M_ZERO);
195 sc->me_fibnum = curthread->td_proc->p_fibnum;
196 ME2IFP(sc) = if_alloc(IFT_TUNNEL);
197 ME2IFP(sc)->if_softc = sc;
198 if_initname(ME2IFP(sc), mename, unit);
199
200 ME2IFP(sc)->if_mtu = MEMTU;
201 ME2IFP(sc)->if_flags = IFF_POINTOPOINT|IFF_MULTICAST;
202 ME2IFP(sc)->if_output = me_output;
203 ME2IFP(sc)->if_ioctl = me_ioctl;
204 ME2IFP(sc)->if_transmit = me_transmit;
205 ME2IFP(sc)->if_qflush = me_qflush;
206#ifdef VIMAGE
207 ME2IFP(sc)->if_reassign = me_reassign;
208#endif
209 ME2IFP(sc)->if_capabilities |= IFCAP_LINKSTATE;
210 ME2IFP(sc)->if_capenable |= IFCAP_LINKSTATE;
211 if_attach(ME2IFP(sc));
212 bpfattach(ME2IFP(sc), DLT_NULL, sizeof(u_int32_t));
213 return (0);
214}
215
216#ifdef VIMAGE
217static void

Callers

nothing calls this directly

Calls 5

mallocFunction · 0.85
if_allocFunction · 0.85
if_initnameFunction · 0.85
if_attachFunction · 0.85
bpfattachFunction · 0.85

Tested by

no test coverage detected