当前位置: 首页>>代码示例>>C++>>正文


C++ STA_HASH函数代码示例

本文整理汇总了C++中STA_HASH函数的典型用法代码示例。如果您正苦于以下问题:C++ STA_HASH函数的具体用法?C++ STA_HASH怎么用?C++ STA_HASH使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了STA_HASH函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mac_hash_add_mac

int mac_hash_add_mac(struct manage_stainfo *maclist,struct mac_info *sta)
{
	asd_printf(ASD_DEFAULT,MSG_DEBUG,"%s :  sta "MACSTR"\n",__func__,MAC2STR(sta->mac));
	sta->hnext = maclist->sta_hash[STA_HASH(sta->mac)];
	maclist->sta_hash[STA_HASH(sta->mac)] = sta;
	return 0;
}
开发者ID:inibir,项目名称:daemongroup,代码行数:7,代码来源:ASDStaManage.c

示例2: mac_hash_del_mac

int mac_hash_del_mac(struct manage_stainfo *maclist,const unsigned char *mac)
{
	asd_printf(ASD_DEFAULT,MSG_DEBUG,"%s :  sta "MACSTR"\n",__func__,MAC2STR(mac));
	struct mac_info *s;
	s = maclist->sta_hash[STA_HASH(mac)];
	if(!s) return -1;
	if(0 == memcmp(s->mac,mac,MAC_LEN) )
	{
		maclist->sta_hash[STA_HASH(mac)]  = s->hnext;
		return 0;
	}
	while((s->hnext != NULL)&&(memcmp(s->hnext->mac,mac,MAC_LEN) != 0))
		s = s->hnext;
	if(NULL == s->hnext) return -1;
	s->hnext = s->hnext->hnext;
	return 0;
}
开发者ID:inibir,项目名称:daemongroup,代码行数:17,代码来源:ASDStaManage.c

示例3: ap_get_ap

struct ap_info * ap_get_ap(struct hostapd_iface *iface, const u8 *ap)
{
	struct ap_info *s;

	s = iface->ap_hash[STA_HASH(ap)];
	while (s != NULL && os_memcmp(s->addr, ap, ETH_ALEN) != 0)
		s = s->hnext;
	return s;
}
开发者ID:MindShow,项目名称:amlogic_s905_kernel_merges,代码行数:9,代码来源:ap_list.c

示例4: __ieee80211_rx_bss_hash_del

/* Caller must hold local->bss_lock */
static void __ieee80211_rx_bss_hash_del(struct ieee80211_local *local,
					struct ieee80211_bss *bss)
{
	struct ieee80211_bss *b, *prev = NULL;
	b = local->bss_hash[STA_HASH(bss->bssid)];
	while (b) {
		if (b == bss) {
			if (!prev)
				local->bss_hash[STA_HASH(bss->bssid)] =
					bss->hnext;
			else
				prev->hnext = bss->hnext;
			break;
		}
		prev = b;
		b = b->hnext;
	}
}
开发者ID:458941968,项目名称:mini2440-kernel-2.6.29,代码行数:19,代码来源:scan.c

示例5: pmk_ap_get_sta

struct PMK_STAINFO * pmk_ap_get_sta(WID_WLAN *WLAN, const u8 *sta)
{
	struct PMK_STAINFO *s;

	s = WLAN->sta_hash[STA_HASH(sta)];
	while (s != NULL && os_memcmp(s->addr, sta, 6) != 0)
		s = s->hnext;
	return s;
}
开发者ID:inibir,项目名称:daemongroup,代码行数:9,代码来源:ASDPMKSta.c

示例6: pmk_ap_sta_hash_del

static void pmk_ap_sta_hash_del(WID_WLAN *WLAN, struct PMK_STAINFO *sta)
{
	struct PMK_STAINFO *s;

	s = WLAN->sta_hash[STA_HASH(sta->addr)];
	if (s == NULL) return;
	if (os_memcmp(s->addr, sta->addr, 6) == 0) {
		WLAN->sta_hash[STA_HASH(sta->addr)] = s->hnext;
		return;
	}

	while (s->hnext != NULL &&
	       os_memcmp(s->hnext->addr, sta->addr, ETH_ALEN) != 0)
		s = s->hnext;
	if (s->hnext != NULL)
		s->hnext = s->hnext->hnext;
	else
		asd_printf(ASD_DEFAULT,MSG_ERROR, "AP: could not remove STA " MACSTR
			   " from hash table", MAC2STR(sta->addr));
}
开发者ID:inibir,项目名称:daemongroup,代码行数:20,代码来源:ASDPMKSta.c

示例7: ap_ap_hash_del

static void ap_ap_hash_del(struct hostapd_iface *iface, struct ap_info *ap)
{
	struct ap_info *s;

	s = iface->ap_hash[STA_HASH(ap->addr)];
	if (s == NULL) return;
	if (os_memcmp(s->addr, ap->addr, ETH_ALEN) == 0) {
		iface->ap_hash[STA_HASH(ap->addr)] = s->hnext;
		return;
	}

	while (s->hnext != NULL &&
	       os_memcmp(s->hnext->addr, ap->addr, ETH_ALEN) != 0)
		s = s->hnext;
	if (s->hnext != NULL)
		s->hnext = s->hnext->hnext;
	else
		printf("AP: could not remove AP " MACSTR " from hash table\n",
		       MAC2STR(ap->addr));
}
开发者ID:MindShow,项目名称:amlogic_s905_kernel_merges,代码行数:20,代码来源:ap_list.c

示例8: ap_sta_hash_del

static void ap_sta_hash_del(struct hostapd_data *hapd, struct sta_info *sta)
{
	struct sta_info *s;

	s = hapd->sta_hash[STA_HASH(sta->addr)];
	if (s == NULL) return;
	if (os_memcmp(s->addr, sta->addr, 6) == 0) {
		hapd->sta_hash[STA_HASH(sta->addr)] = s->hnext;
		return;
	}

	while (s->hnext != NULL &&
	       os_memcmp(s->hnext->addr, sta->addr, ETH_ALEN) != 0)
		s = s->hnext;
	if (s->hnext != NULL)
		s->hnext = s->hnext->hnext;
	else
		wpa_printf(MSG_DEBUG, "AP: could not remove STA " MACSTR
			   " from hash table", MAC2STR(sta->addr));
}
开发者ID:MindShow,项目名称:amlogic_s905_kernel_merges,代码行数:20,代码来源:sta_info.c

示例9: __ieee80211_rx_bss_hash_add

/* Caller must hold local->bss_lock */
static void __ieee80211_rx_bss_hash_add(struct ieee80211_local *local,
					struct ieee80211_bss *bss)
{
	u8 hash_idx;

	if (bss_mesh_cfg(bss))
		hash_idx = mesh_id_hash(bss_mesh_id(bss),
					bss_mesh_id_len(bss));
	else
		hash_idx = STA_HASH(bss->bssid);

	bss->hnext = local->bss_hash[hash_idx];
	local->bss_hash[hash_idx] = bss;
}
开发者ID:458941968,项目名称:mini2440-kernel-2.6.29,代码行数:15,代码来源:scan.c

示例10: maclist_get_mac

struct mac_info * maclist_get_mac(struct manage_stainfo *maclist,const unsigned char *mac)
{
	asd_printf(ASD_DEFAULT,MSG_DEBUG,"%s :  sta "MACSTR"\n",__func__,MAC2STR(mac));
	struct mac_info *sta = NULL;
	sta = maclist->sta_hash[STA_HASH(mac)];
	while(sta)
	{
		if(0 == memcmp(sta->mac,mac,MAC_LEN) )
			return sta;
		sta = sta->hnext;
	}
	
	asd_printf(ASD_DEFAULT,MSG_DEBUG,"%s : "MACSTR" has not get!\n",__func__,MAC2STR(mac));
	return NULL;
}
开发者ID:inibir,项目名称:daemongroup,代码行数:15,代码来源:ASDStaManage.c

示例11: ieee80211_rx_bss_get

struct ieee80211_bss *
ieee80211_rx_bss_get(struct ieee80211_local *local, u8 *bssid, int freq,
		     u8 *ssid, u8 ssid_len)
{
	struct ieee80211_bss *bss;

	spin_lock_bh(&local->bss_lock);
	bss = local->bss_hash[STA_HASH(bssid)];
	while (bss) {
		if (!bss_mesh_cfg(bss) &&
		    !memcmp(bss->bssid, bssid, ETH_ALEN) &&
		    bss->freq == freq &&
		    bss->ssid_len == ssid_len &&
		    (ssid_len == 0 || !memcmp(bss->ssid, ssid, ssid_len))) {
			atomic_inc(&bss->users);
			break;
		}
		bss = bss->hnext;
	}
	spin_unlock_bh(&local->bss_lock);
	return bss;
}
开发者ID:458941968,项目名称:mini2440-kernel-2.6.29,代码行数:22,代码来源:scan.c

示例12: ap_ap_hash_add

static void ap_ap_hash_add(struct hostapd_iface *iface, struct ap_info *ap)
{
	ap->hnext = iface->ap_hash[STA_HASH(ap->addr)];
	iface->ap_hash[STA_HASH(ap->addr)] = ap;
}
开发者ID:MindShow,项目名称:amlogic_s905_kernel_merges,代码行数:5,代码来源:ap_list.c

示例13: Handle_read


//.........这里部分代码省略.........
        {
            ethertype = *(pos_vlan+2) << 8;
            ethertype |= *(pos_vlan+3);
        }

        if((ethertype == ETH_P_PRE_AUTH) || (ethertype == ETH_P_PAE))
        {
            isVlanTag = 1;
            DBGPRINT(RT_DEBUG_TRACE,"Recv vlan tag for 802.1x. (%02x %02x)\n", *(pos_vlan), *(pos_vlan+1));
        }
    }
#endif

    if ((ethertype == ETH_P_PRE_AUTH) || (ethertype == ETH_P_PAE))
    {
        // search this packet is coming from which interface
        for (i = 0; i < rtapd->conf->SsidNum; i++)
        {
            if (memcmp(da, rtapd->own_addr[i], 6) == 0)
            {
                apidx = i;
                break;
            }
        }

        if(i >= rtapd->conf->SsidNum)
        {
            DBGPRINT(RT_DEBUG_WARN, "Receive unexpected DA (%02x:%02x:%02x:%02x:%02x:%02x)\n",
                     MAC2STR(da));
            return;
        }

        if (ethertype == ETH_P_PRE_AUTH)
        {
            DBGPRINT(RT_DEBUG_TRACE, "Receive WPA2 pre-auth packet for %s%d\n", rtapd->prefix_wlan_name, apidx);
        }
        else
        {
            DBGPRINT(RT_DEBUG_TRACE, "Receive EAP packet for %s%d\n", rtapd->prefix_wlan_name, apidx);
        }
    }
    else
    {
        DBGPRINT(RT_DEBUG_ERROR, "Receive unexpected ethertype 0x%04X!!!\n", ethertype);
        return;
    }

    pos = rec->xframe;

    //strip 4 bytes for valn tag
    if(isVlanTag)
    {
        pos += 4;
        left -= 4;
    }

    /* Check if this is a internal command or not */
    if (left == sizeof(RalinkIe) &&
        RTMPCompareMemory(pos, RalinkIe, 5) == 0)
    {
        u8  icmd = *(pos + 5);

        switch(icmd)
        {
            case DOT1X_DISCONNECT_ENTRY:
            {
                struct sta_info *s;

                s = rtapd->sta_hash[STA_HASH(sa)];
                while (s != NULL && memcmp(s->addr, sa, 6) != 0)
                    s = s->hnext;

                DBGPRINT(RT_DEBUG_TRACE, "Receive discard-notification form wireless driver.\n");
                if (s)
                {
                    DBGPRINT(RT_DEBUG_TRACE,"This station(%02x:%02x:%02x:%02x:%02x:%02x) is removed.\n", MAC2STR(sa));
                    Ap_free_sta(rtapd, s);
                }
                else
                {
                    DBGPRINT(RT_DEBUG_INFO, "This station(%02x:%02x:%02x:%02x:%02x:%02x) doesn't exist.\n", MAC2STR(sa));
                }
            }
            break;

            case DOT1X_RELOAD_CONFIG:
                Handle_reload_config(rtapd);
                break;

            default:
                DBGPRINT(RT_DEBUG_ERROR, "Unknown internal command(%d)!!!\n", icmd);
                break;
        }
    }
    else
    {
        /* Process the general EAP packet */
        ieee802_1x_receive(rtapd, sa, &apidx, pos, left, ethertype, sock);
    }
}
开发者ID:Brainiarc7,项目名称:openwrt-xiaomi-mini,代码行数:101,代码来源:rtdot1x.c

示例14: pmk_ap_sta_hash_add

void pmk_ap_sta_hash_add(WID_WLAN *WLAN, struct PMK_STAINFO *sta)
{
	sta->hnext = WLAN->sta_hash[STA_HASH(sta->addr)];
	WLAN->sta_hash[STA_HASH(sta->addr)] = sta;
}
开发者ID:inibir,项目名称:daemongroup,代码行数:5,代码来源:ASDPMKSta.c


注:本文中的STA_HASH函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。