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

Function get80211opmode

tools/ifconfig/ifieee80211.c:4673–4698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4671}
4672
4673static enum ieee80211_opmode
4674get80211opmode(int s)
4675{
4676 struct ifmediareq ifmr;
4677
4678 (void) memset(&ifmr, 0, sizeof(ifmr));
4679 (void) strlcpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name));
4680
4681 if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0) {
4682 if (ifmr.ifm_current & IFM_IEEE80211_ADHOC) {
4683 if (ifmr.ifm_current & IFM_FLAG0)
4684 return IEEE80211_M_AHDEMO;
4685 else
4686 return IEEE80211_M_IBSS;
4687 }
4688 if (ifmr.ifm_current & IFM_IEEE80211_HOSTAP)
4689 return IEEE80211_M_HOSTAP;
4690 if (ifmr.ifm_current & IFM_IEEE80211_IBSS)
4691 return IEEE80211_M_IBSS;
4692 if (ifmr.ifm_current & IFM_IEEE80211_MONITOR)
4693 return IEEE80211_M_MONITOR;
4694 if (ifmr.ifm_current & IFM_IEEE80211_MBSS)
4695 return IEEE80211_M_MBSS;
4696 }
4697 return IEEE80211_M_STA;
4698}
4699
4700#if 0
4701static void

Callers 2

list_stationsFunction · 0.85
ieee80211_statusFunction · 0.85

Calls 3

memsetFunction · 0.85
strlcpyFunction · 0.50
ioctlFunction · 0.50

Tested by

no test coverage detected