add winpcap 4.0.2 from url http://www.winpcap.org/
[natblaster.git] / src / peer / spoof.h
blob8418cf05657e497808332dbd2a8b5dfe76de47c8
1 /*****************************************************************************
2 * Copyright 2005 Daniel Ferullo *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 *****************************************************************************/
18 /**
19 * @file spoof.h
20 * @author Daniel Ferullo (ferullo@cmu.edu)
22 * @brief functions to spoof/forge tcp/ip packets
25 #ifndef __SPOOF_H__
26 #define __SPOOF_H__
28 #include "errorcodes.h"
29 #include "def.h"
31 /**
32 * @brief spoofs a tcp packet
34 * @param tcp_hdr the tcp_packet_info_t with the essential information to spoof * a tcp packet based on.
35 * @param device the device to spoof on
36 * @param payload pointer to the payload of the packet. if NULL then no payload
37 * @param payload_len the length of the payload
38 * @param ttl the TTL to use on the spoofed packets
40 * @return SUCCESS, errorcode on failure
42 errorcode spoof(tcp_packet_info_t *tcp_hdr, char *device, void *payload,
43 unsigned long payload_len, short ttl);
45 #endif /* __SPOOF_H__ */