Changeset 351

Show
Ignore:
Timestamp:
06/04/08 00:25:47 (7 months ago)
Author:
bwilson
Message:

all attack markings made the same, fix events for federation

Location:
code/trunk
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • code/trunk/backend/agents/skaion.py

    r344 r351  
    2121        def handleSTOP(self): 
    2222                if self.name == self.getVar('master'): 
    23                         run("/usr/local/tg/bin.master/TG_stop.sh -k") 
     23                        run("/usr/local/tg/bin.master/TG_stop.sh") 
    2424 
    2525 
  • code/trunk/backend/counters.py

    r299 r351  
    128128 
    129129        def addIncomingAttackCounter(self, intf, handle): 
    130                 run("iptables -t mangle -A PREROUTING  -m mark ! --mark %d -i %s -m dscp --dscp 63" % (handle, intf)) 
     130                run("iptables -t mangle -A PREROUTING  -m mark ! --mark %d -i %s -m dscp --dscp 56" % (handle, intf)) 
    131131 
    132132        def addOutgoingAttackCounter(self, intf, handle): 
    133                 run("iptables -t mangle -A POSTROUTING -m mark ! --mark %d -o %s -m dscp --dscp 63" % (handle, intf)) 
     133                run("iptables -t mangle -A POSTROUTING -m mark ! --mark %d -o %s -m dscp --dscp 56" % (handle, intf)) 
    134134 
    135135        def loadCounters(self): 
     
    140140                # 0   1   2   3    4      5        6           7        8     9    10   11   12    13    
    141141                # 0   0  all  --  ifin  ifout  0.0.0.0/0   0.0.0.0/0   MARK match !0x4 
    142                 # 0   0  all  --  ifin  ifout  0.0.0.0/0   0.0.0.0/0   MARK match !0x5 DSCP match 0x3f 
     142                # 0   0  all  --  ifin  ifout  0.0.0.0/0   0.0.0.0/0   MARK match !0x5 DSCP match 0x38 
    143143 
    144144                for line in output.splitlines(): 
     
    262262class CounterThread(threading.Thread): 
    263263 
    264         def __init__(self, txq, hostname, iflist, controlip): 
     264        def __init__(self, txq, hostname, iflist): 
    265265                threading.Thread.__init__(self) 
    266266                self.queue = txq 
    267                 self.guiip = controlip 
    268267 
    269268                if (sys.platform == 'linux2'): 
     
    300299                                if (lastsend + 5) < now: 
    301300                                        args = base64.b64encode(zlib.compress('|'.join(self.dataqueue), 9)) 
    302                                         self.queue.put(Event(host=self.guiip, type='GUI', event='COUNTERS', args=args)) 
     301                                        self.queue.put(Event(host='control', type='GUI', event='COUNTERS', args=args)) 
    303302                                        lastsend = now 
    304303                                        self.dataqueue = [] 
  • code/trunk/backend/daemon.py

    r328 r351  
    117117                # Special type that doesn't need an instantiated agent module 
    118118                if (msg.type == 'GUI'): 
     119                        if self.emulabstate.node != 'control': 
     120                                return  # If I'm not the control node, I don't care. 
     121 
    119122                        if (msg.event == 'LOG'): 
    120123                                self.logforgui.addMsg(msg.args) 
     
    183186class LogThread(threading.Thread): 
    184187 
    185         def __init__(self, txq, filename, mynode, guiip): 
     188        def __init__(self, txq, filename, mynode): 
    186189                threading.Thread.__init__(self) 
    187190                self.queue = txq 
    188191                self.filename = filename 
    189192                self.mynode = mynode 
    190                 self.guiip = guiip 
    191193 
    192194        def run (self): 
     
    208210                                                        continue 
    209211 
    210                                                 self.queue.put(Event(host=self.guiip, type='GUI', event='LOG', 
     212                                                self.queue.put(Event(host='control', type='GUI', event='LOG', 
    211213                                                                                        args=self.mynode+" "+line.strip())) 
    212214                                        else: 
     
    262264        pubsub = PubSubSocket(state.controlip, state.eid) 
    263265        pubsub.start() 
    264         pubsub.subscribe({}) # Everything that is for our host 
     266        if state.node == 'control': 
     267                pubsub.subscribe({"HOST":"*,control"}) # All generic and control messages 
     268        else: 
     269                pubsub.subscribe({"HOST":"*"}) # All generic messages 
    265270 
    266271        # Start a processor for received events 
     
    270275        try: 
    271276                # Start threads for sending log messages and reading of counters 
    272                 guiip = socket.gethostbyname("control.%s.%s" % (state.exp, state.proj)) 
    273                 LogThread(pubsub, '/local/logs/gui.log', state.node, guiip).start() 
     277                #guiip = socket.gethostbyname("control.%s.%s" % (state.exp, state.proj)) 
     278                LogThread(pubsub, '/local/logs/gui.log', state.node).start() 
    274279                if state.node != 'control': 
    275                         counters.CounterThread(pubsub, state.node, state.iflist, guiip).start() 
     280                        counters.CounterThread(pubsub, state.node, state.iflist).start() 
    276281        except: 
    277282                logging.error("Unable to setup GUI log or counter log", exc_info=1) 
  • code/trunk/backend/emulab.py

    r310 r351  
    5050                name = inet = mask = mac = '' 
    5151 
    52                 # WinXP image tmcc doesn't seem to write a local copy for us 
    53                 if (sys.platform == 'cygwin'): 
    54                         iffile = pipeIn('/usr/local/etc/emulab/tmcc ifconfig') 
    55                 else: 
    56                         iffile = open('/var/emulab/boot/tmcc/ifconfig', 'r') 
     52                iffile = pipeIn('/usr/local/etc/emulab/tmcc ifconfig') 
    5753 
    5854                # Split into lines 
  • code/trunk/backend/pubsub.py

    r316 r351  
    461461                sub.addConstraint("EXPT", self.exp) 
    462462                sub.addConstraint("SCHEDULER", 0) 
    463                 sub.addConstraint("HOST", "*,"+self.ip) 
    464463                for (k, v) in pairs.iteritems(): 
    465464                        sub.addConstraint(k, v) 
  • code/trunk/ccode/flooder.c

    r311 r351  
    196196        p->protoid = LIBNET_PTAG_INITIALIZER; 
    197197        p->interfacename = NULL; 
    198         p->attack_identifier = (63 << 2);  /* id is 63 but DSCP field is left 6 bits of old TOS field */ 
     198        p->attack_identifier = 0xE0; /* id is ipprecendence 7, tos 0 */ 
    199199 
    200200        p->ratetype = 0; 
  • code/trunk/tars.py

    r344 r351  
    9494        dotree('fbsd62') 
    9595        dotree('winxp') 
     96        dotree('skaion') 
     97elif sys.argv[1] == 'video': 
     98        tar = MyTarFile.open('/share/seer/seer-videodata.tgz', 'w:gz') 
     99        tar.addtree('trees/video', '') 
     100        tar.close() 
    96101else: 
    97102        dotree(sys.argv[1]) 
     103