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

Function if_clone_create

freebsd/net/if_clone.c:177–212  ·  view source on GitHub ↗

* Lookup and create a clone network interface. */

Source from the content-addressed store, hash-verified

175 * Lookup and create a clone network interface.
176 */
177int
178if_clone_create(char *name, size_t len, caddr_t params)
179{
180 struct if_clone *ifc;
181
182 /* Try to find an applicable cloner for this request */
183 IF_CLONERS_LOCK();
184 LIST_FOREACH(ifc, &V_if_cloners, ifc_list)
185 if (ifc->ifc_type == SIMPLE) {
186 if (ifc_simple_match(ifc, name))
187 break;
188 } else {
189 if (ifc->ifc_match(ifc, name))
190 break;
191 }
192#ifdef VIMAGE
193 if (ifc == NULL && !IS_DEFAULT_VNET(curvnet)) {
194 CURVNET_SET_QUIET(vnet0);
195 LIST_FOREACH(ifc, &V_if_cloners, ifc_list)
196 if (ifc->ifc_type == SIMPLE) {
197 if (ifc_simple_match(ifc, name))
198 break;
199 } else {
200 if (ifc->ifc_match(ifc, name))
201 break;
202 }
203 CURVNET_RESTORE();
204 }
205#endif
206 IF_CLONERS_UNLOCK();
207
208 if (ifc == NULL)
209 return (EINVAL);
210
211 return (if_clone_createif(ifc, name, len, params));
212}
213
214void
215if_clone_addif(struct if_clone *ifc, struct ifnet *ifp)

Callers 3

ifioctlFunction · 0.85
tuncloneFunction · 0.85
ff_veth_setup_interfaceFunction · 0.85

Calls 2

ifc_simple_matchFunction · 0.85
if_clone_createifFunction · 0.85

Tested by

no test coverage detected