Ejemplo n.º 1
0
 def verifyNetworkManager(self, node, wlanID=0):
     """
     First verify if the mac address of the ap is included at NetworkManager.conf
     
     :param node: node
     :param wlanID: wlan ID
     """
     if 'phywlan' in node.params:
         wlanID = 1
     for wlan in range(len(node.params['wlan']) + wlanID):
         if 'inNamespace' not in node.params or wlanID == 1:
             if node.type != 'station':
                 options = dict()
                 if 'phywlan' not in node.params:
                     self.configureIface(node, wlan)
                 else:
                     if wlan == 1:
                         wlan = 0
                         self.configureIface(node, wlan)
                     else:
                         iface = node.params['phywlan']
                         options.setdefault('intfName1', iface)
                 cls = TCLinkWirelessAP
                 cls(node, **options)
         elif 'inNamespace' in node.params:
             cls = TCLinkWirelessAP
             cls(node)
         AccessPoint.setIPMAC(node, wlan)
         if len(node.params['ssid']) > 1 and wlan == 0:
             break
Ejemplo n.º 2
0
 def verifyNetworkManager(self, node, wlanID=0):
     """
     First verify if the mac address of the ap is included at NetworkManager.conf
     
     :param node: node
     :param wlanID: wlan ID
     """
     if 'phywlan' in node.params:
         wlanID = 1
     for wlan in range(len(node.params['wlan']) + wlanID):
         if wlanID == 1:
             wlan = 0
         if 'inNamespace' not in node.params or wlanID == 1:
             if node.type != 'station':
                 options = dict()
                 if 'phywlan' not in node.params:
                     intf = module.wlan_list[0]
                     module.wlan_list.pop(0)
                     node.renameIface(intf, node.params['wlan'][wlan])
                 else:
                     iface = node.params['phywlan']
                     options.setdefault('intfName1', iface)
                 cls = TCLinkWirelessAP
                 cls(node, **options)
         AccessPoint.setIPMAC(node, wlan)
         if 'phywlan' in node.params:
             node.params.pop("phywlan", None)
         if len(node.params['ssid']) > 1 and wlan == 0:
             break
Ejemplo n.º 3
0
    def verifyNetworkManager(cls, node):
        """
        First verify if the mac address of the ap is included at
        NetworkManager.conf
        
        :param node: node
        """
        from mininet.node import Station

        for wlan in range(len(node.params['wlan'])):
            if 'inNamespace' not in node.params:
                if not isinstance(node, Station):
                    options = dict()
                    if 'phywlan' in node.params and wlan == 0:
                        iface = node.params['phywlan']
                        options.setdefault('intfName1', iface)
                    else:
                        cls.configureIface(node, wlan)
                    TCLinkWirelessAP(node, **options)
            elif 'inNamespace' in node.params:
                cls = TCLinkWirelessAP
                cls(node)
            AccessPoint.setIPMAC(node, wlan)
            if 'vssids' in node.params:
                break
Ejemplo n.º 4
0
    def configureAP(cls, ap, wlanID=0, aplist=None):
        """Configure AP
        
        :param ap: ap node
        :param wlanID: wlan ID
        """
        if 'phywlan' in ap.params:
            wlanID = 1
        for wlan in range(len(ap.params['wlan']) + wlanID):
            if ap.params['ssid'][wlan] != '':
                if wlanID == 1:
                    wlan = 0
                if 'encrypt' in ap.params and 'config' not in ap.params:
                    if ap.params['encrypt'][wlan] == 'wpa':
                        ap.auth_algs = 1
                        ap.wpa = 1
                        if 'ieee80211r' in ap.params \
                                and ap.params['ieee80211r'] == 'yes':
                            ap.wpa_key_mgmt = 'FT-EAP'
                        else:
                            ap.wpa_key_mgmt = 'WPA-EAP'
                        ap.rsn_pairwise = 'TKIP CCMP'
                        ap.wpa_passphrase = ap.params['passwd'][0]
                    elif ap.params['encrypt'][wlan] == 'wpa2':
                        ap.auth_algs = 1
                        ap.wpa = 2
                        if 'ieee80211r' in ap.params \
                                and ap.params['ieee80211r'] == 'yes' \
                                and 'authmode' not in ap.params:
                            ap.wpa_key_mgmt = 'FT-PSK'
                        elif 'authmode' in ap.params \
                                and ap.params['authmode'] == '8021x':
                            ap.wpa_key_mgmt = 'WPA-EAP'
                        else:
                            ap.wpa_key_mgmt = 'WPA-PSK'
                        ap.rsn_pairwise = 'CCMP'
                        if 'authmode' not in ap.params:
                            ap.wpa_passphrase = ap.params['passwd'][0]
                    elif ap.params['encrypt'][wlan] == 'wep':
                        ap.auth_algs = 2
                        ap.wep_key0 = ap.params['passwd'][0]

                AccessPoint(ap, wlan=wlan, aplist=aplist)

                if 'phywlan' not in ap.params:
                    iface = ap.params['wlan'][wlan]
                else:
                    iface = ap.params['phywlan']

                if not cls.enable_wmediumd:
                    cls.setBw(ap, wlan, iface)

                if 'phywlan' in ap.params:
                    ap.params.pop("phywlan", None)

                #if ap.func[0] != 'ap':
                ap.params['frequency'][wlan] = ap.getFrequency(0)

                if 'vssids' in ap.params:
                    break