Created
April 14, 2019 18:48
-
-
Save Estella/b2a11fcab481265feb2d78c4aa3b2b71 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// c++ udp6_rpc_tester.c -ldnet -lpcap -lusi++ | |
#include <stdlib.h> | |
#include <iostream> | |
#include <usi++/usi++.h> | |
using namespace usipp; using namespace std; | |
int main(int argc, char **argv) { | |
if (argc < 3) { cout << arg[0] << "<source ipv6> <destination ipv6> [interface]\n"; exit(1); } | |
UDP6 udp(argv[2]); | |
if (argc == 4) { | |
usipp::pcap *rx = reinterpret_cast<usipp::pcap *>(udp.raw_rx()); | |
if (rx->init_device(argv[3], 1, usipp::max_packet_size < 0) { cerr << udp.why() << endl; return 1; } | |
TX_pcap_eth *tx = new TX_pcap_eth(rx); tx_set_l2src("01:02:03:04:05:06"); tx_set_l2dst("11:22:33:44:55:66"); tx->set_type(numbers::eth_p_ipv6); udp.register_tx(tx); | |
} | |
udp.set_srcport(52888); udp.set_proto(17); udp.set_dstport(111); udp.set_src(argv[1]); udp.sendpack("\xFF\xFF"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
packets