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

Function domediaopt

tools/ifconfig/ifmedia.c:328–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326}
327
328static void
329domediaopt(const char *val, int clear, int s)
330{
331 struct ifmediareq *ifmr;
332 int options;
333
334 ifmr = ifmedia_getstate(s);
335
336 options = get_media_options(IFM_TYPE(ifmr->ifm_ulist[0]), val);
337
338 strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
339 ifr.ifr_media = ifmr->ifm_current;
340 if (clear)
341 ifr.ifr_media &= ~options;
342 else {
343 if (options & IFM_HDX) {
344 ifr.ifr_media &= ~IFM_FDX;
345 options &= ~IFM_HDX;
346 }
347 ifr.ifr_media |= options;
348 }
349 ifmr->ifm_current = ifr.ifr_media;
350 callback_register(setifmediacallback, (void *)ifmr);
351}
352
353static void
354setmediainst(const char *val, int d, int s, const struct afswtch *afp)

Callers 2

setmediaoptFunction · 0.85
unsetmediaoptFunction · 0.85

Calls 4

ifmedia_getstateFunction · 0.85
get_media_optionsFunction · 0.85
callback_registerFunction · 0.85
strlcpyFunction · 0.50

Tested by

no test coverage detected