Found by codespell.
"/who [<name>] List all nodes or show information about the given node.\n"
"/listgroup <name> List all nodes in a given group.\n"
"/canonical -h<hostname> -p<port> Set Canonical address to be present in invitation.\n"
- " Any one of two options an be specified. Atleast one option must be present\n"
+ " Any one of two options an be specified. At least one option must be present\n"
"/quit Exit this program.\n"
);
} else {
error = true;
}
- // If any error occured during reading or writing, exit.
+ // If any error occurred during reading or writing, exit.
if(error) {
unlink(tmpname);
return false;
* @return A pointer to an array containing devtool_edge_t elements,
* or NULL in case of an error.
* If the @a edges @a argument was not NULL, then the
- * retun value can be either the same value or a different
+ * return value can be either the same value or a different
* value. If the new values is NULL, then the old array
* will have been freed by Meshlink.
*/
#define MESHLINK_DISCOVERY_H
/*
- discovery.h -- header for dicovery.c
+ discovery.h -- header for discovery.c
Copyright (C) 2014, 2017 Guus Sliepen <guus@meshlink.io>
This program is free software; you can redistribute it and/or modify
* fake library for ssh
*
* This file includes getaddrinfo(), freeaddrinfo() and gai_strerror().
- * These funtions are defined in rfc2133.
+ * These functions are defined in rfc2133.
*
* But these functions are not implemented correctly. The minimum subset
- * is implemented for ssh use only. For exapmle, this routine assumes
+ * is implemented for ssh use only. For example, this routine assumes
* that ai_family is AF_INET. Don't use it for another purpose.
*/
* fake library for ssh
*
* This file includes getnameinfo().
- * These funtions are defined in rfc2133.
+ * These functions are defined in rfc2133.
*
* But these functions are not implemented correctly. The minimum subset
- * is implemented for ssh use only. For exapmle, this routine assumes
+ * is implemented for ssh use only. For example, this routine assumes
* that ai_family is AF_INET. Don't use it for another purpose.
*/
* @param appname The application name which will be used in the mesh.
* @param devclass The device class which will be used in the mesh.
*
- * @return This function will return a pointer to a meshlink::mesh if MeshLink has succesfully set up its configuration files, NULL otherwise.
+ * @return This function will return a pointer to a meshlink::mesh if MeshLink has successfully set up its configuration files, NULL otherwise.
*/
bool open(const char *confbase, const char *name, const char *appname, dev_class_t devclass) {
handle = meshlink_open(confbase, name, appname, devclass);
(void)message;
}
- /// This functions is called whenever another node attemps to open a channel to the local node.
+ /// This functions is called whenever another node attempts to open a channel to the local node.
/**
* If the channel is accepted, the poll_callback will be set to channel_poll and can be
* changed using set_channel_poll_cb(). Likewise, the receive callback is set to
/** This function causes MeshLink to open network sockets, make outgoing connections, and
* create a new thread, which will handle all network I/O.
*
- * @return This function will return true if MeshLink has succesfully started its thread, false otherwise.
+ * @return This function will return true if MeshLink has successfully started its thread, false otherwise.
*/
bool start() {
meshlink_set_receive_cb(handle, &receive_trampoline);
* If the port is set to 0, then MeshLink will listen on a port
* that is randomly assigned by the operating system every time open() is called.
*
- * @return This function returns true if the port was succesfully changed, false otherwise.
+ * @return This function returns true if the port was successfully changed, false otherwise.
*/
bool set_port(int port) {
return meshlink_set_port(handle, port);
/// Use an invitation to join a mesh.
/** This function allows the local node to join an existing mesh using an invitation URL generated by another node.
* An invitation can only be used if the local node has never connected to other nodes before.
- * After a succesfully accepted invitation, the name of the local node may have changed.
+ * After a successfully accepted invitation, the name of the local node may have changed.
*
* This function may only be called on a mesh that has not been started yet and which is not already part of an existing mesh.
*
* @param confbase The directory in which MeshLink stores its configuration files.
* After the function returns, the application is free to overwrite or free @a confbase @a.
*
- * @return This function will return true if the MeshLink instance was succesfully destroyed, false otherwise.
+ * @return This function will return true if the MeshLink instance was successfully destroyed, false otherwise.
*/
static inline bool destroy(const char *confbase) {
return meshlink_destroy(confbase);
return finalize_join(mesh);
case 2:
- logger(mesh, MESHLINK_DEBUG, "Invitation succesfully accepted.\n");
+ logger(mesh, MESHLINK_DEBUG, "Invitation successfully accepted.\n");
shutdown(mesh->sock, SHUT_RDWR);
mesh->success = true;
break;
// TODO: more finegrained locking.
// Ideally we want to put the data into the UTCP connection's send buffer.
- // Then, preferrably only if there is room in the receiver window,
+ // Then, preferably only if there is room in the receiver window,
// kick the meshlink thread to go send packets.
pthread_mutex_lock(&mesh->mesh_mutex);
MESHLINK_EEXIST, ///< Node already exists
MESHLINK_EINTERNAL, ///< MeshLink internal error
MESHLINK_ERESOLV, ///< MeshLink could not resolve a hostname
- MESHLINK_ESTORAGE, ///< MeshLink coud not load or write data from/to disk
+ MESHLINK_ESTORAGE, ///< MeshLink could not load or write data from/to disk
MESHLINK_ENETWORK, ///< MeshLink encountered a network error
MESHLINK_EPEER, ///< A peer caused an error
MESHLINK_ENOTSUP, ///< The operation is not supported in the current configuration of MeshLink
/** This is a thread local variable that contains the error code of the most recent error
* encountered by a MeshLink API function called in the current thread.
* The variable is only updated when an error is encountered, and is not reset to MESHLINK_OK
- * if a function returned succesfully.
+ * if a function returned successfully.
*/
extern __thread meshlink_errno_t meshlink_errno;
*
* @param mesh A handle which represents an instance of MeshLink.
*
- * @return This function will return true if MeshLink has succesfully started, false otherwise.
+ * @return This function will return true if MeshLink has successfully started, false otherwise.
*/
extern bool meshlink_start(meshlink_handle_t *mesh);
* @param confbase The directory in which MeshLink stores its configuration files.
* After the function returns, the application is free to overwrite or free @a confbase.
*
- * @return This function will return true if the MeshLink instance was succesfully destroyed, false otherwise.
+ * @return This function will return true if the MeshLink instance was successfully destroyed, false otherwise.
*/
extern bool meshlink_destroy(const char *confbase);
* If the port is set to 0, then MeshLink will listen on a port
* that is randomly assigned by the operating system every time meshlink_open() is called.
*
- * @return This function returns true if the port was succesfully changed, false otherwise.
+ * @return This function returns true if the port was successfully changed, false otherwise.
*/
extern bool meshlink_set_port(meshlink_handle_t *mesh, int port);
/// Use an invitation to join a mesh.
/** This function allows the local node to join an existing mesh using an invitation URL generated by another node.
* An invitation can only be used if the local node has never connected to other nodes before.
- * After a succesfully accepted invitation, the name of the local node may have changed.
+ * After a successfully accepted invitation, the name of the local node may have changed.
*
* This function may only be called on a mesh that has not been started yet and which is not already part of an existing mesh.
*
if(type == SPTPS_HANDSHAKE) {
if(!from->status.validkey) {
- logger(mesh, MESHLINK_INFO, "SPTPS key exchange with %s succesful", from->name);
+ logger(mesh, MESHLINK_INFO, "SPTPS key exchange with %s successful", from->name);
from->status.validkey = true;
from->status.waitingforkey = false;
fclose(f);
- logger(mesh, MESHLINK_INFO, "Key succesfully received from %s", c->name);
+ logger(mesh, MESHLINK_INFO, "Key successfully received from %s", c->name);
//TODO: callback to application to inform of an accepted invitation
c->status.invitation_used = true;
- logger(mesh, MESHLINK_INFO, "Invitation %s succesfully sent to %s", cookie, c->name);
+ logger(mesh, MESHLINK_INFO, "Invitation %s successfully sent to %s", cookie, c->name);
return true;
}
(void)request;
c->status.pinged = false;
- /* Succesful connection, reset timeout if this is an outgoing connection. */
+ /* Successful connection, reset timeout if this is an outgoing connection. */
if(c->outgoing) {
c->outgoing->timeout = 0;
owner = lookup_node(mesh, (char *)hdr->destination);
logger(mesh, MESHLINK_DEBUG, "Routing packet from \"%s\" to \"%s\"\n", hdr->source, hdr->destination);
- //Check Lenght
+ //Check Length
if(!checklength(source, packet, sizeof(*hdr))) {
return;
}
if(owner == NULL) {
//Lookup failed
- logger(mesh, MESHLINK_WARNING, "Cant lookup the owner of a packet in the route() function. This should never happen!\n");
+ logger(mesh, MESHLINK_WARNING, "Can't lookup the owner of a packet in the route() function. This should never happen!\n");
logger(mesh, MESHLINK_WARNING, "Destination was: %s\n", hdr->destination);
return;
}
#define MESHLINK_XALLOC_H
/*
- xalloc.h -- malloc and related fuctions with out of memory checking
+ xalloc.h -- malloc and related functions with out of memory checking
Copyright (C) 2014, 2017 Guus Sliepen <guus@meshlink.io>
This program is free software; you can redistribute it and/or modify
container->stop(container);
assert(container->start(container, 0, NULL));
- strncpy(container_ips[node], new_ip, sizeof(new_ip)); // Save the new IP Addres
+ strncpy(container_ips[node], new_ip, sizeof(new_ip)); // Save the new IP Address
PRINT_TEST_CASE_MSG("Node '%s' IP Address changed to %s\n", state_ptr->node_names[node],
container_ips[node]);
}
* @param callback callback which handles the mesh event packet.
* @param timeout timeout for which the the function has to wait for the event.
*
- * @return This function returns true if a mesh event occured else false if timeout exceeded.
+ * @return This function returns true if a mesh event occurred else false if timeout exceeded.
*/
extern bool wait_for_event(mesh_event_callback_t callback, int timeout);
* @param payload Payload can also be attached along with the mesh event if any, else NULL can
* can be specified.
* @param payload_length Length of the payload if specified else 0 can be specified.
- * the maximum payload size can be upto PAYLOAD_MAX_SIZE and if the
+ * the maximum payload size can be up to PAYLOAD_MAX_SIZE and if the
* PAYLOAD_MAX_SIZE macro is changed it should not exceed the UDP datagram size.
*
* @return This function returns true on success else returns false.
bool ret = meshlink_sign(NULL, data, strlen(data) + 1, sig, &ssize);
if(!ret) {
- PRINT_TEST_CASE_MSG("meshlink_sign Successfuly reported error on passing NULL as mesh_handle arg\n");
+ PRINT_TEST_CASE_MSG("meshlink_sign Successfully reported error on passing NULL as mesh_handle arg\n");
return true;
}
meshlink_destroy("signconf");
if(!ret) {
- PRINT_TEST_CASE_MSG("meshlink_sign Successfuly reported error on passing NULL as data arg\n");
+ PRINT_TEST_CASE_MSG("meshlink_sign Successfully reported error on passing NULL as data arg\n");
return true;
} else {
PRINT_TEST_CASE_MSG("meshlink_sign FAILED to report error on passing NULL as data arg\n");
meshlink_destroy("signconf");
if(!ret) {
- PRINT_TEST_CASE_MSG("meshlink_sign Successfuly reported error on passing 0 as size of data arg\n");
+ PRINT_TEST_CASE_MSG("meshlink_sign Successfully reported error on passing 0 as size of data arg\n");
return true;
}
meshlink_destroy("signconf");
if(!ret) {
- PRINT_TEST_CASE_MSG("meshlink_sign Successfuly reported error on passing NULL as sign arg\n");
+ PRINT_TEST_CASE_MSG("meshlink_sign Successfully reported error on passing NULL as sign arg\n");
return true;
}
meshlink_destroy("signconf");
if(!ret) {
- PRINT_TEST_CASE_MSG("meshlink_sign Successfuly reported error on passing NULL as signsize arg\n");
+ PRINT_TEST_CASE_MSG("meshlink_sign Successfully reported error on passing NULL as signsize arg\n");
return true;
}
meshlink_destroy("signconf");
if(!ret) {
- PRINT_TEST_CASE_MSG("meshlink_sign Successfuly reported error on passing signsize < MESHLINK_SIGLEN arg\n");
+ PRINT_TEST_CASE_MSG("meshlink_sign Successfully reported error on passing signsize < MESHLINK_SIGLEN arg\n");
return true;
}
Expected Result:
Channels should be formed between nodes of sub-mesh & coremesh, nodes with in sub-mesh
- and should be able to exchange data. Lis of all nodes should only conatin four nodes
- and the list of submesh should only conatin two nodes of that submesh.
+ and should be able to exchange data. Lis of all nodes should only contain four nodes
+ and the list of submesh should only contain two nodes of that submesh.
*/
static bool test_steps_submesh_02(void) {
char *invite_corenode2, *invite_app1node1, *invite_app2node1, *invite_app1node2, *invite_app2node2;
return false;
}
- PRINT_TEST_CASE_MSG("meshlink_verify Successfuly verified data\n");
+ PRINT_TEST_CASE_MSG("meshlink_verify Successfully verified data\n");
return true;
}
meshlink_destroy("verifyconf");
if(!ret) {
- PRINT_TEST_CASE_MSG("meshlink_sign Successfuly reported error on passing NULL as mesh_handle arg\n");
+ PRINT_TEST_CASE_MSG("meshlink_sign Successfully reported error on passing NULL as mesh_handle arg\n");
return true;
}
}
if(!argv[CMD_LINE_ARG_INVITEURL]) {
- fprintf(stderr, "Generating Inviation to PEER\n");
+ fprintf(stderr, "Generating Invitation to PEER\n");
invite_peer = execute_invite("peer", NULL);
assert(invite_peer != NULL);
sleep(1);
}
- fprintf(stderr, "Generating Inviation to PEER\n");
+ fprintf(stderr, "Generating Invitation to PEER\n");
invite_peer = execute_invite("peer", NULL);
assert(invite_peer != NULL);
node_pmtu[i].mtu_discovery.count += 1;
node_pmtu[i].mtu_size = mtu_len;
- } else if(sscanf(text, "SPTPS key exchange with %s succesful", node_name) == 1) {
+ } else if(sscanf(text, "SPTPS key exchange with %s successful", node_name) == 1) {
find_node_index(i, node_name);
node_pmtu[i].mtu_start.time = cur_time;
node_pmtu[i].mtu_start.count += 1;
node_pmtu[i].mtu_discovery.count += 1;
node_pmtu[i].mtu_size = mtu_len;
- } else if(sscanf(text, "SPTPS key exchange with %s succesful", node_name) == 1) {
+ } else if(sscanf(text, "SPTPS key exchange with %s successful", node_name) == 1) {
find_node_index(i, node_name);
node_pmtu[i].mtu_start.time = cur_time;
node_pmtu[i].mtu_start.count += 1;