Exemplo n.º 1
0
	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)
Exemplo n.º 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)
Exemplo n.º 3
0
	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)
Exemplo n.º 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)