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

Function gre_clone_create

freebsd/net/if_gre.c:172–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170 vnet_gre_uninit, NULL);
171
172static int
173gre_clone_create(struct if_clone *ifc, int unit, caddr_t params)
174{
175 struct gre_softc *sc;
176
177 sc = malloc(sizeof(struct gre_softc), M_GRE, M_WAITOK | M_ZERO);
178 sc->gre_fibnum = curthread->td_proc->p_fibnum;
179 GRE2IFP(sc) = if_alloc(IFT_TUNNEL);
180 GRE2IFP(sc)->if_softc = sc;
181 if_initname(GRE2IFP(sc), grename, unit);
182
183 GRE2IFP(sc)->if_mtu = GREMTU;
184 GRE2IFP(sc)->if_flags = IFF_POINTOPOINT|IFF_MULTICAST;
185 GRE2IFP(sc)->if_output = gre_output;
186 GRE2IFP(sc)->if_ioctl = gre_ioctl;
187 GRE2IFP(sc)->if_transmit = gre_transmit;
188 GRE2IFP(sc)->if_qflush = gre_qflush;
189#ifdef VIMAGE
190 GRE2IFP(sc)->if_reassign = gre_reassign;
191#endif
192 GRE2IFP(sc)->if_capabilities |= IFCAP_LINKSTATE;
193 GRE2IFP(sc)->if_capenable |= IFCAP_LINKSTATE;
194 if_attach(GRE2IFP(sc));
195 bpfattach(GRE2IFP(sc), DLT_NULL, sizeof(u_int32_t));
196 return (0);
197}
198
199#ifdef VIMAGE
200static 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