Changeset 351
- Timestamp:
- 06/04/08 00:25:47 (7 months ago)
- Location:
- code/trunk
- Files:
-
- 7 modified
-
backend/agents/skaion.py (modified) (1 diff)
-
backend/counters.py (modified) (4 diffs)
-
backend/daemon.py (modified) (5 diffs)
-
backend/emulab.py (modified) (1 diff)
-
backend/pubsub.py (modified) (1 diff)
-
ccode/flooder.c (modified) (1 diff)
-
tars.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/backend/agents/skaion.py
r344 r351 21 21 def handleSTOP(self): 22 22 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") 24 24 25 25 -
code/trunk/backend/counters.py
r299 r351 128 128 129 129 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)) 131 131 132 132 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)) 134 134 135 135 def loadCounters(self): … … 140 140 # 0 1 2 3 4 5 6 7 8 9 10 11 12 13 141 141 # 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 0x3 f142 # 0 0 all -- ifin ifout 0.0.0.0/0 0.0.0.0/0 MARK match !0x5 DSCP match 0x38 143 143 144 144 for line in output.splitlines(): … … 262 262 class CounterThread(threading.Thread): 263 263 264 def __init__(self, txq, hostname, iflist , controlip):264 def __init__(self, txq, hostname, iflist): 265 265 threading.Thread.__init__(self) 266 266 self.queue = txq 267 self.guiip = controlip268 267 269 268 if (sys.platform == 'linux2'): … … 300 299 if (lastsend + 5) < now: 301 300 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)) 303 302 lastsend = now 304 303 self.dataqueue = [] -
code/trunk/backend/daemon.py
r328 r351 117 117 # Special type that doesn't need an instantiated agent module 118 118 if (msg.type == 'GUI'): 119 if self.emulabstate.node != 'control': 120 return # If I'm not the control node, I don't care. 121 119 122 if (msg.event == 'LOG'): 120 123 self.logforgui.addMsg(msg.args) … … 183 186 class LogThread(threading.Thread): 184 187 185 def __init__(self, txq, filename, mynode , guiip):188 def __init__(self, txq, filename, mynode): 186 189 threading.Thread.__init__(self) 187 190 self.queue = txq 188 191 self.filename = filename 189 192 self.mynode = mynode 190 self.guiip = guiip191 193 192 194 def run (self): … … 208 210 continue 209 211 210 self.queue.put(Event(host= self.guiip, type='GUI', event='LOG',212 self.queue.put(Event(host='control', type='GUI', event='LOG', 211 213 args=self.mynode+" "+line.strip())) 212 214 else: … … 262 264 pubsub = PubSubSocket(state.controlip, state.eid) 263 265 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 265 270 266 271 # Start a processor for received events … … 270 275 try: 271 276 # 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() 274 279 if state.node != 'control': 275 counters.CounterThread(pubsub, state.node, state.iflist , guiip).start()280 counters.CounterThread(pubsub, state.node, state.iflist).start() 276 281 except: 277 282 logging.error("Unable to setup GUI log or counter log", exc_info=1) -
code/trunk/backend/emulab.py
r310 r351 50 50 name = inet = mask = mac = '' 51 51 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') 57 53 58 54 # Split into lines -
code/trunk/backend/pubsub.py
r316 r351 461 461 sub.addConstraint("EXPT", self.exp) 462 462 sub.addConstraint("SCHEDULER", 0) 463 sub.addConstraint("HOST", "*,"+self.ip)464 463 for (k, v) in pairs.iteritems(): 465 464 sub.addConstraint(k, v) -
code/trunk/ccode/flooder.c
r311 r351 196 196 p->protoid = LIBNET_PTAG_INITIALIZER; 197 197 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 */ 199 199 200 200 p->ratetype = 0; -
code/trunk/tars.py
r344 r351 94 94 dotree('fbsd62') 95 95 dotree('winxp') 96 dotree('skaion') 97 elif sys.argv[1] == 'video': 98 tar = MyTarFile.open('/share/seer/seer-videodata.tgz', 'w:gz') 99 tar.addtree('trees/video', '') 100 tar.close() 96 101 else: 97 102 dotree(sys.argv[1]) 103
