def injection_create(self, src_query="", dst_query="", type="icmp4", payload="", interval=1000, src_ip="", dst_ip="", src_mac="", dst_mac="", count=1, icmp_id=0, src_port=0, dst_port=0, increment=False, ttl=64): data = json.dumps({ "Src": src_query, "Dst": dst_query, "SrcPort": src_port, "DstPort": dst_port, "SrcIP": src_ip, "DstIP": dst_ip, "SrcMAC": src_mac, "DstMAC": dst_mac, "Type": type, "Count": count, "ICMPID": icmp_id, "Interval": interval, "Payload": payload, "Increment": increment, "TTL": ttl }) r = self.request(self.INJECTION_PATH, method="POST", data=data) return PacketInjection.from_object(r)
def injection_list(self): objs = self.request(self.INJECTION_PATH) return [PacketInjection.from_object(o) for o in objs.values()]