MCPcopy Create free account
hub / github.com/USArmyResearchLab/Dshell / __init__

Method __init__

dshell/core.py:1155–1209  ·  view source on GitHub ↗

Initializes Connection object Args: first_packet: the first Packet object to initialize connection

(self, first_packet)

Source from the content-addressed store, hash-verified

1153 CLOSED = "closed"
1154
1155 def __init__(self, first_packet):
1156 """
1157 Initializes Connection object
1158
1159 Args:
1160 first_packet: the first Packet object to initialize connection
1161 """
1162 self.addr = first_packet.addr
1163 # TODO: Rename these variables to something more verbose like "source_ip"
1164 # I keep getting confused whether the "s" stands for "source" or "server".
1165 self.sip = first_packet.sip
1166 self.smac = first_packet.smac
1167 self.sport = first_packet.sport
1168 self.sipcc = first_packet.sipcc
1169 self.siplat = first_packet.siplat
1170 self.siplon = first_packet.siplon
1171 self.sipasn = first_packet.sipasn
1172 self.clientip = first_packet.sip
1173 self.clientmac = first_packet.smac
1174 self.clientport = first_packet.sport
1175 self.clientcc = first_packet.sipcc
1176 self.clientlat = first_packet.siplat
1177 self.clientlon = first_packet.siplon
1178 self.clientasn = first_packet.sipasn
1179 self.dip = first_packet.dip
1180 self.dmac = first_packet.dmac
1181 self.dport = first_packet.dport
1182 self.dipcc = first_packet.dipcc
1183 self.diplat = first_packet.diplat
1184 self.diplon = first_packet.diplon
1185 self.dipasn = first_packet.dipasn
1186 self.serverip = first_packet.dip
1187 self.servermac = first_packet.dmac
1188 self.serverport = first_packet.dport
1189 self.servercc = first_packet.dipcc
1190 self.serverlat = first_packet.diplat
1191 self.serverlon = first_packet.diplon
1192 self.serverasn = first_packet.dipasn
1193 self.protocol = first_packet.protocol
1194 self.protocol_num = first_packet.protocol_num
1195 self.ts = first_packet.ts
1196 self.dt = first_packet.dt
1197 self.starttime = first_packet.dt
1198 self.endtime = first_packet.dt
1199 self.client_state = None
1200 self.server_state = None
1201 # self.blobs = []
1202 self.packets = [] # keeps track of packets in connection.
1203 self.stop = False
1204 self.handled = False
1205
1206 # Cache of created blobs
1207 self._blob_cache = []
1208
1209 self.add_packet(first_packet)
1210
1211 @property
1212 def duration(self):

Callers

nothing calls this directly

Calls 1

add_packetMethod · 0.95

Tested by

no test coverage detected