structure for later semantic interpretation. Returns EINVAL if the
command string is unparseable or zero for success.
- comamnd_string will be modified in-place with NUL characters terminating
- tokens, and the command_t will use pointers to the conents of
+ command_string will be modified in-place with NUL characters terminating
+ tokens, and the command_t will use pointers to the contents of
command_string without copying, so any interpretation of the
command_t structure requires that the command_string memory has not yet
been freed or otherwise reused.
/*
Check the current socket address, and if it is the same
as the source address we intend, we will skip the bind.
- This is to accomodate Solaris, which, as of Solaris 11.3,
+ This is to accommodate Solaris, which, as of Solaris 11.3,
will return an EINVAL error on bind if the socket is already
bound, even if the same address is used.
*/
}
}
- /* The traffic class in IPv6 is analagous to ToS in IPv4 */
+ /* The traffic class in IPv6 is analogous to ToS in IPv4 */
if (setsockopt(send_socket, IPPROTO_IPV6,
IPV6_TCLASS, ¶m->type_of_service, sizeof(int))) {
return -1;
/* The packet "mark" used for mark-based routing on Linux */
int routing_mark;
- /* Time to live for the transmited probe */
+ /* Time to live for the transmitted probe */
int ttl;
/* The packet size (in bytes) including protocol headers */
We use the Cygwin pipe() to create the pipes, but in the ICMP
service thread we use the Win32 HANDLE that corresponds to the
- recieving end of the input pipe to wait for ICMP requests.
+ receiving end of the input pipe to wait for ICMP requests.
*/
}
/*
- Convienience similar to error(), but for reporting Windows
+ Convenience similar to error(), but for reporting Windows
error codes instead of errno codes.
*/
void error_win(int exit_code, int win_error, const char *str) {
}
/*
- On Windows, an implementation of check_probe_timeout is unnecesary because
+ On Windows, an implementation of check_probe_timeout is unnecessary because
timeouts are managed by ICMP.DLL, including a call to the I/O completion
routine when the time fully expires.
*/
/*
Read all available packets through our receiving raw socket, and
- handle any responses to probes we have preivously sent.
+ handle any responses to probes we have previously sent.
*/
static
void receive_replies_from_recv_socket(
struct timeval departure_time;
};
-/* We'll use rack sockets to send and recieve probes on Unix systems */
+/* We'll use rack sockets to send and receive probes on Unix systems */
struct net_state_platform_t {
/* true if we were successful at opening IPv4 sockets */
bool ip4_present;
Sleep until we receive a new probe response, a new command on the
command stream, or a probe timeout. On Unix systems, this means
we use select to wait on file descriptors for the command stream
- and the raw recieve socket.
+ and the raw receive socket.
*/
void wait_for_activity(
struct command_buffer_t *command_buffer,
#define SEQUENCE_NUM 33000
/*
- Check to see if the packet we've recieved is intended for this test
+ Check to see if the packet we've received is intended for this test
process. We expected the ICMP sequence number to be equal to our
process ID.
*/
@unittest.skipIf(sys.platform == 'cygwin', 'No Cygwin test')
class TestIPv6Parameters(mtrpacket.MtrPacketTest):
- 'Test packet paramter customization for IPv6'
+ 'Test packet parameter customization for IPv6'
@unittest.skipUnless(mtrpacket.HAVE_IPV6, 'No IPv6')
def test_param(self):
def test_ttl_expired(self):
'Test sending a probe which will have its time-to-live expire'
- # Probe Goolge's DNS server, but give the probe only one hop
+ # Probe Google's DNS server, but give the probe only one hop
# to live.
self.write_command('16 send-probe ip-4 8.8.8.8 ttl 1')
reply = self.parse_reply()
'''Test sending multiple probes in parallel
We will expect the probes to complete out-of-order by sending
- a probe to a distant host immeidately followed by a probe to
+ a probe to a distant host immediately followed by a probe to
the local host.'''
success_count = 0
def test_ttl_expired(self):
'Test sending a probe which will have its time-to-live expire'
- # Probe Goolge's DNS server, but give the probe only one hop
+ # Probe Google's DNS server, but give the probe only one hop
# to live.
cmd = '53 send-probe ip-6 ' + self.google_addr + ' ttl 1'
self.write_command(cmd)
extern char *myname;
/*
- Execute mtr-packet, allowing the MTR_PACKET evironment to override
+ Execute mtr-packet, allowing the MTR_PACKET environment to override
the PATH when locating the executable.
*/
static
/*
Terminate the reply string at the newline, which
is necessary in the case where we are able to read
- mulitple replies arriving simultaneously.
+ multiple replies arriving simultaneously.
*/
*end_of_reply = 0;
error(EXIT_FAILURE, errno, "signal");
}
- /* Close all unneccessary FDs.
+ /* Close all unnecessary FDs.
for debugging and error reporting, keep std-in/out/err. */
for (i = 3; i < fromdns[1]; i++) {
if (i == todns[0])
have a range for "rand()" that runs to 32768, and the
destination range is 10000, you end up with 4 out of 32768
0-2768's and only 3 out of 32768 for results 2769 .. 9999.
- As our detination range (in the example 10000) is much
+ As our destination range (in the example 10000) is much
smaller (reasonable packet sizes), and our rand() range much
larger, this effect is insignificant. Oh! That other formula
didn't work. */