3 International Computer Science Institute
6 This file may contain software code originally developed for the
7 Sting project. The Sting software carries the following copyright:
9 Copyright (c) 1998, 1999
10 Stefan Savage and the University of Washington.
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions
16 1. Redistributions of source code must retain the above copyright
17 notice, this list of conditions and the following disclaimer.
18 2. Redistributions in binary form must reproduce the above copyright
19 notice, this list of conditions and the following disclaimer in the
20 documentation and/or other materials provided with the distribution.
21 3. All advertising materials mentioning features or use of this software
22 must display the following acknowledgment:
23 This product includes software developed by ACIRI, the AT&T
24 Center for Internet Research at ICSI (the International Computer
25 Science Institute). This product may also include software developed
26 by Stefan Savage at the University of Washington.
27 4. The names of ACIRI, ICSI, Stefan Savage and University of Washington
28 may not be used to endorse or promote products derived from this software
29 without specific prior written permission.
31 THIS SOFTWARE IS PROVIDED BY ICSI AND CONTRIBUTORS ``AS IS'' AND
32 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34 ARE DISCLAIMED. IN NO EVENT SHALL ICSI OR CONTRIBUTORS BE LIABLE
35 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
39 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
40 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
44 #define MAXREQUESTLEN 1000
46 #define SESSION_DEBUG_LOW 1
47 #define SESSION_DEBUG_MEDIUM 2
48 #define SESSION_DEBUG_HIGH 3
52 /* target name, as specified by the user */
53 char targetName
[MAXHOSTNAMELEN
];
55 /* DNS name of hosts */
56 char targetHostName
[MAXHOSTNAMELEN
];
57 char sourceHostName
[MAXHOSTNAMELEN
];
59 /* raw socket we use to send on */
62 /* connection endpoint identifiers */
68 /* sender info, from RFC 793 */
69 u_int32_t iss
; // initial send sequence
70 u_int32_t snd_una
; // sequence numbers of unacknowledged data
71 u_int32_t snd_nxt
; // sequence number to be sent next
105 int firewall_rule_number
;
109 /* New loss-rate parameters */
113 /* results are suspect for various reasons */
117 /* Drops and reordering startistics */
119 int num_unwanted_drops
;
122 int num_dup_transmissions
;
124 int num_pkts_0_dup_acks
;
125 int num_pkts_1_dup_acks
;
126 int num_pkts_2_dup_acks
;
127 int num_pkts_3_dup_acks
;
128 int num_pkts_4_or_more_dup_acks
;
134 /* For ByteCounting test */
135 int bytecounting_type
;
136 int ack_bytes
; /* How many bytes covered per ACK */
137 int ack_rate
; /* ACK [every | every other | every third |...] packet */
139 /* For WindowScale Option test */
140 u_int8_t receiving_shift_count
;
141 u_int8_t sending_shift_count
;
143 /* For MidBoxTTL test */
149 //void SendSessionPacket(struct IPPacket *packet,
150 void SendSessionPacket(struct IPPacket
*packet
,
151 u_int16_t ip_len
, /* Total size of IP datagram */
153 u_int16_t ip_optlen
, /* IP options len - New */
154 u_int16_t optlen
, /* TCP options len */
157 void SendICMPReply(struct IPPacket
*p
);
159 void SendPkt(struct IPPacket
*p
, u_int16_t ip_len
, int ip_optlen
, int tcp_optlen
);
161 void SendICMPPkt(struct ICMPUnreachableErrorPacket
*p
, u_int16_t ip_len
);
163 void StorePacket (struct IPPacket
*p
);
165 int EstablishSession(u_int32_t sourceAddress
, \
166 u_int16_t sourcePort
, \
167 u_int32_t targetAddress
,
168 u_int16_t targetPort
, \
179 void rcvData (void (*ackData
)(struct IPPacket
*p
));
181 void SendRequest(char *filename
, void (*ackData
)(struct IPPacket
*p
));
183 int PrepareRequest(char *data
, char *filename
) ;