| 144 | |
| 145 | |
| 146 | class ConnectionAttributes: |
| 147 | |
| 148 | def __init__(self, val): |
| 149 | self.val = val |
| 150 | |
| 151 | def http_version(self): |
| 152 | v = self.val['http_version']['m_version'] |
| 153 | return (v >> 16, v & 0xffff) |
| 154 | |
| 155 | def src_addr(self): |
| 156 | ip = self.val['src_addr'] |
| 157 | s = struct.pack('!I', socket.ntohl(int(ip['sin']['sin_addr']['s_addr']))) |
| 158 | return socket.inet_ntoa(s) |
| 159 | |
| 160 | def dst_addr(self): |
| 161 | ip = self.val['dst_addr'] |
| 162 | s = struct.pack('!I', socket.ntohl(int(ip['sin']['sin_addr']['s_addr']))) |
| 163 | return socket.inet_ntoa(s) |
| 164 | |
| 165 | |
| 166 | class HttpSM: |
no outgoing calls
no test coverage detected