Create NDP - NS applicable for this interface
(self, addr=None)
| 570 | ) |
| 571 | |
| 572 | def create_ndp_req(self, addr=None): |
| 573 | """Create NDP - NS applicable for this interface""" |
| 574 | if not addr: |
| 575 | addr = self.local_ip6 |
| 576 | nsma = in6_getnsma(inet_pton(socket.AF_INET6, addr)) |
| 577 | d = inet_ntop(socket.AF_INET6, nsma) |
| 578 | |
| 579 | return ( |
| 580 | Ether(dst=in6_getnsmac(nsma)) |
| 581 | / IPv6(dst=d, src=self.remote_ip6) |
| 582 | / ICMPv6ND_NS(tgt=addr) |
| 583 | / ICMPv6NDOptSrcLLAddr(lladdr=self.remote_mac) |
| 584 | ) |
| 585 | |
| 586 | def resolve_arp(self, pg_interface=None): |
| 587 | """Resolve ARP using provided packet-generator interface |