示例#1
0
文件: scan.py 项目: miguelhdo/py80211
	def _add_matches_attrs(self):
		if self._matches:
			i = 0

			matchset = nl.nla_nest_start(self._nl_msg._msg, nl80211.ATTR_SCHED_SCAN_MATCH)
			for match in self._matches:
				nest = nl.nla_nest_start(self._nl_msg._msg, i)
				if 'ssid' in match:
					nl.nla_put(self._nl_msg._msg, nl80211.SCHED_SCAN_MATCH_ATTR_SSID, match['ssid'])
				i += 1
				nl.nla_nest_end(self._nl_msg._msg, nest)

			nl.nla_nest_end(self._nl_msg._msg, matchset)
示例#2
0
    def _add_matches_attrs(self):
        if self._matches:
            i = 0

            matchset = nla_nest_start(self._nl_msg,
                                      nl80211.ATTR_SCHED_SCAN_MATCH)
            for match in self._matches:
                nest = nla_nest_start(self._nl_msg, i)
                if 'ssid' in match:
                    nla_put(self._nl_msg, nl80211.SCHED_SCAN_MATCH_ATTR_SSID,
                            match['ssid'])
                i += 1
                nla_nest_end(self._nl_msg, nest)

            nla_nest_end(self._nl_msg, matchset)
示例#3
0
文件: scan.py 项目: miguelhdo/py80211
	def _add_scan_attrs(self):
		if self._ssids:
			i = 0
			nest = nl.nla_nest_start(self._nl_msg._msg, nl80211.ATTR_SCAN_SSIDS)
			for ssid in self._ssids:
				nl.nla_put(self._nl_msg._msg, i, ssid)
				i += 1
			nl.nla_nest_end(self._nl_msg._msg, nest)
		if self._freqs:
			i = 0
			nest = nl.nla_nest_start(self._nl_msg._msg, nl80211.ATTR_SCAN_FREQUENCIES)
			for freq in self._freqs:
				nl.nla_put_u32(self._nl_msg._msg, i, freq)
				i += 1
			nl.nla_nest_end(self._nl_msg._msg, nest)
		if self._flags != 0:
			nl.nla_put_u32(self._nl_msg._msg, nl80211.ATTR_SCAN_FLAGS, self._flags)
		if self._ies:
			nl.nla_put(self._nl_msg._msg, nl80211.ATTR_IE, self._ies)
示例#4
0
 def _add_attrs(self):
     super(scan_start_base, self)._add_attrs()
     if self._ssids:
         i = 0
         nest = nla_nest_start(self._nl_msg, nl80211.ATTR_SCAN_SSIDS)
         for ssid in self._ssids:
             nla_put(self._nl_msg, i, ssid)
             i += 1
         nla_nest_end(self._nl_msg, nest)
     if self._freqs:
         i = 0
         nest = nla_nest_start(self._nl_msg, nl80211.ATTR_SCAN_FREQUENCIES)
         for freq in self._freqs:
             nla_put_u32(self._nl_msg, i, freq)
             i += 1
         nla_nest_end(self._nl_msg, nest)
     if self._flags != 0:
         nla_put_u32(self._nl_msg, nl80211.ATTR_SCAN_FLAGS, self._flags)
     if self._ies:
         nla_put(self._nl_msg, nl80211.ATTR_IE, self._ies)
示例#5
0
 def put_obj_id(self, msg):
     nla_put_u32(msg._msg, nl80211.ATTR_IFINDEX, self._ifidx)
     nla_put(msg._msg, nl80211.ATTR_MAC, self._mac)
示例#6
0
文件: station.py 项目: arend/py80211
	def put_obj_id(self, msg):
		nla_put_u32(msg._msg, nl80211.ATTR_IFINDEX, self._ifidx)
		nla_put(msg._msg, nl80211.ATTR_MAC, self._mac)