14 | | #!/usr/bin/python |
| 14 | from oml4py import OMLBase |
| 15 | |
| 16 | class CoopShim(BaseShim): |
| 17 | |
| 18 | coop = {} |
| 19 | |
| 20 | coop['oml'] = OMLBase("coopshim","coopshim2","n3","tcp:omfserver-witest.poly.edu:3003") |
| 21 | coop['oml'].addmp("req", "id:long total:long") |
| 22 | coop['oml'].addmp("recv", "id:long total:long source:string") |
| 23 | coop['oml'].addmp("sent", "id:long total:long dest:string") |
| 24 | coop['oml'].start() |
| 25 | |
| 26 | |
| 27 | ... |
| 28 | |
| 29 | self.coop['oml'].inject("req", [pkt_id, self.coop['n_req']]) |
| 30 | |
| 31 | ... |
| 32 | |
| 33 | self.coop['oml'].inject("recv", [pkt_id, self.coop['n_recv'], str(srcip)]) |
| 34 | |
| 35 | ... |
| 36 | |
| 37 | self.coop['oml'].inject("sent", [str(pkt_id), self.coop['n_sent'], str(srcip)]) |
| 38 | |