Ejemplo n.º 1
0
    def initialize(self, args):
        """
        Initialize the opmode manager
        :param self: An OpMode object
        :param args: An argparse.Namespace object
        :type self: OpMode
        :type args: argparse.Namespace
        :return: None
        :rtype: None
        """

        self._perfect_card, self._is_one_phy_interface =\
            interfaces.is_add_vif_required(args)
        self._check_args(args)
Ejemplo n.º 2
0
    def initialize(self, args):
        """
        Initialize the opmode manager
        :param self: An OpMode object
        :param args: An argparse.Namespace object
        :type self: OpMode
        :type args: argparse.Namespace
        :return: None
        :rtype: None
        """

        self._perfect_card, self._use_one_phy =\
            interfaces.is_add_vif_required(args)
        self._check_args(args)
Ejemplo n.º 3
0
    def set_op_mode(self, args):
        """
        Sets the operation mode.

        An operation mode resembles how the tool will best leverage
        the given resources.

        Modes of operation
        1) Advanced 0x1
          2 cards, 2 interfaces
          i) AP, ii) EM
        2) Advanced and Internet 0x2
          3 cards, 3 interfaces
          i) AP, ii) EM iii) Internet
        3) AP-only and Internet 0x3
          2 cards, 2 interfaces
          i) AP, ii) Internet
        4) AP-only 0x4
          1 card, 1 interface
          i) AP
        5) Advanced w/ 1 vif support AP/Monitor 0x5
          1 card, 2 interfaces
          i) AP, ii) Extensions
        6) Advanced and Internet w/ 1 vif support AP/Monitor 0x6
          2 cards, 3 interfaces
          i) AP, ii) Extensions, iii) Internet
        """

        card, is_single_perfect_card = interfaces.is_add_vif_required(args)
        if not args.internetinterface and not args.nojamming:
            if not is_single_perfect_card:
                self.op_mode = OP_MODE1
            else:
                if card is not None:
                    self.network_manager.add_virtual_interface(card)
                self.op_mode = OP_MODE5
        if args.internetinterface and not args.nojamming:
            if not is_single_perfect_card:
                self.op_mode = OP_MODE2
            else:
                if card is not None:
                    self.network_manager.add_virtual_interface(card)
                self.op_mode = OP_MODE6
        if args.internetinterface and args.nojamming:
            self.op_mode = OP_MODE3
        if args.nojamming and not args.internetinterface:
            self.op_mode = OP_MODE4