Home | History | Annotate | Download | only in py

Lines Matching refs:IP

46             "arp.pln": 4, # Protocol Addres Length is 4 (IP v4).
98 This is useful to send IP packets with send_ip() to hosts that haven't
108 """Resolves the hw_addr of an IP address locally when it is known.
114 @param ip_addr: The IP address to resolve encoded in network format.
120 # An IP host group address is mapped to an Ethernet multicast address
121 # by placing the low-order 23-bits of the IP address into the low-order
123 # Because there are 28 significant bits in an IP host group address,
127 if int_ip_addr & 0xF0000000 == 0xE0000000: # Multicast IP address
133 raise SimpleHostError("Unknown destination IP host.")
137 """Sends an IP packet.
139 The source IP address and the hardware layer is automatically filled.
140 @param pkt: A dpkg.ip.IP packet.
158 """Forwards all the TCP/IP traffic on a given port to another host.
165 @param dest_addr: A host IP address on the same network in plain text.
171 'ip.dst': self._bin_ip_addr,
172 'ip.p': dpkt.ip.IP_PROTO_TCP}, self._handle_tcp_forward)
190 shost = pkt.ip.src
191 sport = pkt.ip.tcp.sport
192 dport = pkt.ip.tcp.dport
198 pkt.ip.tcp.sport = oport
199 pkt.ip.tcp.dport = fport
200 pkt.ip.dst = fhost
201 pkt.ip.tcp.sum = 0 # Force checksum
202 self.send_ip(pkt.ip)
221 pkt.ip.tcp.sport = lport
222 pkt.ip.tcp.dport = fport
223 pkt.ip.dst = fhost
224 pkt.ip.tcp.sum = 0 # Force checksum
225 self.send_ip(pkt.ip)
302 "ip.dst": socket.inet_aton(ip_addr),
303 "ip.udp.dport": port},
304 lambda pkt: recv_callback(pkt.ip.udp.data,
305 socket.inet_ntoa(pkt.ip.src),
306 pkt.ip.udp.sport))
324 pkt_ip = dpkt.ip.IP(
326 ttl = 255, # The comon value for IP packets.
327 off = dpkt.ip.IP_DF, # Don't frag.
328 p = dpkt.ip.IP_PROTO_UDP,