univnautes / usr / local / univnautes / sp / ipfw_context_list.py @ e7fae17e
1 |
#!/usr/bin/env python
|
---|---|
2 |
|
3 |
from socket import * |
4 |
IP_FW_CTX_GET = 95 |
5 |
s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW) |
6 |
buf = s.getsockopt(IPPROTO_IP, IP_FW_CTX_GET, 1000) |
7 |
for l in buf.split('\n'): |
8 |
ctx = l.strip().split(':')[0] |
9 |
if ctx: |
10 |
print ctx |
11 |
|