mirror of
https://github.com/wangyu-/udp2raw.git
synced 2025-02-08 08:09:34 +08:00
trival
This commit is contained in:
parent
976e0495e5
commit
a75afc94bb
2
makefile
2
makefile
@ -10,7 +10,7 @@ cc_arm= /toolchains/arm-2014.05/bin/arm-none-linux-gnueabi-g++
|
|||||||
#cc_bcm2708=/home/wangyu/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++
|
#cc_bcm2708=/home/wangyu/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++
|
||||||
FLAGS= -std=c++11 -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers ${OPT}
|
FLAGS= -std=c++11 -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers ${OPT}
|
||||||
|
|
||||||
COMMON=main.cpp lib/md5.cpp encrypt.cpp log.cpp network.cpp common.cpp connection.cpp misc.cpp fd_manager.cpp -lpthread my_ev.cpp -isystem libev -lpcap -D_DEFAULT_SOURCE #`libnet-config --defines` `libnet-config --libs`
|
COMMON=main.cpp lib/md5.cpp encrypt.cpp log.cpp network.cpp common.cpp connection.cpp misc.cpp fd_manager.cpp -lpthread my_ev.cpp -isystem libev -lpcap -D_DEFAULT_SOURCE `libnet-config --defines` `libnet-config --libs`
|
||||||
|
|
||||||
SOURCES= $(COMMON) lib/aes_faster_c/aes.cpp lib/aes_faster_c/wrapper.cpp
|
SOURCES= $(COMMON) lib/aes_faster_c/aes.cpp lib/aes_faster_c/wrapper.cpp
|
||||||
SOURCES_TINY_AES= $(COMMON) lib/aes.cpp
|
SOURCES_TINY_AES= $(COMMON) lib/aes.cpp
|
||||||
|
@ -856,6 +856,7 @@ int send_raw_ip(raw_info_t &raw_info,const char * payload,int payloadlen)
|
|||||||
if(! send_with_pcap)
|
if(! send_with_pcap)
|
||||||
{
|
{
|
||||||
#ifndef NO_LIBNET
|
#ifndef NO_LIBNET
|
||||||
|
|
||||||
g_ptag=libnet_build_ipv4(ip_tot_len, iph->tos, ntohs(iph->id), ntohs(iph->frag_off),
|
g_ptag=libnet_build_ipv4(ip_tot_len, iph->tos, ntohs(iph->id), ntohs(iph->frag_off),
|
||||||
iph->ttl , iph->protocol , iph->check , iph->saddr, iph->daddr,
|
iph->ttl , iph->protocol , iph->check , iph->saddr, iph->daddr,
|
||||||
(const unsigned char *)payload, payloadlen, libnet_handle, g_ptag);
|
(const unsigned char *)payload, payloadlen, libnet_handle, g_ptag);
|
||||||
@ -866,6 +867,13 @@ int send_raw_ip(raw_info_t &raw_info,const char * payload,int payloadlen)
|
|||||||
ret= libnet_write(libnet_handle);
|
ret= libnet_write(libnet_handle);
|
||||||
|
|
||||||
assert(ret!=-1);
|
assert(ret!=-1);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
iph->tot_len=htons(ip_tot_len);
|
||||||
|
iph->check =csum ((unsigned short *) send_raw_ip_buf, iph->ihl*4);
|
||||||
|
libnet_write_raw_ipv4(libnet_handle,(const unsigned char *)send_raw_ip_buf,ip_tot_len); //this api is marked as internal, so avoid using it.
|
||||||
|
*/
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user