#include #include int outbound(struct packetp_ctx *ctx, uint8_t *packet, void *unused) { struct ip_hdr *ip_head; /* Defined in dnet/ip.h */ ip_head = (struct ip_hdr *)packet; ip_head->ip_tos = IP_TOS_PREC_FLASHOVERRIDE; /* Also defined in dnet/ip.h */ return(0); } int main(int argc, char **argv) { int c; struct addr temp_addr; struct packetp_ctx *pp_ctx; /* Initialize the Packet Purgatory context */ pp_ctx = packetp_init(); /* Retreive arguments passed in, and add the required info to the context */ while((c=getopt(argc, argv, "p:r:")) != -1) { switch(c) { case 'p': addr_aton(optarg, &temp_addr); packetp_set_proxy(pp_ctx, &temp_addr); break; case 'r': addr_aton(optarg, &temp_addr); packetp_set_target(pp_ctx, &temp_addr); break; } } packetp_set_type(pp_ctx, PP_FAKEIP); packetp_start(pp_ctx, outbound, NULL, NULL); return(0); }