From ec02aca3d7888f072c5c0d52ba6b5c37ed42b69e Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sun, 17 Mar 2019 21:46:45 +0100 Subject: [PATCH] Fix spelling errors. Found by codespell. --- examples/groupchat.c | 2 +- src/conf.c | 2 +- src/devtools.h | 2 +- src/discovery.h | 2 +- src/fake-getaddrinfo.c | 4 ++-- src/fake-getnameinfo.c | 4 ++-- src/meshlink++.h | 12 ++++++------ src/meshlink.c | 4 ++-- src/meshlink.h | 12 ++++++------ src/net_packet.c | 2 +- src/protocol_auth.c | 4 ++-- src/protocol_misc.c | 2 +- src/route.c | 4 ++-- src/xalloc.h | 2 +- test/blackbox/common/containers.c | 2 +- test/blackbox/common/mesh_event_handler.h | 4 ++-- test/blackbox/run_blackbox_tests/test_cases_sign.c | 12 ++++++------ .../run_blackbox_tests/test_cases_submesh02.c | 4 ++-- test/blackbox/run_blackbox_tests/test_cases_verify.c | 4 ++-- test/blackbox/test_case_meta_conn_04/node_sim_nut.c | 2 +- test/blackbox/test_case_meta_conn_05/node_sim_nut.c | 2 +- .../test_case_optimal_pmtu_01/node_sim_nut.c | 2 +- .../test_case_optimal_pmtu_07/node_sim_nut.c | 2 +- 23 files changed, 46 insertions(+), 46 deletions(-) diff --git a/examples/groupchat.c b/examples/groupchat.c index a866943a..f84b3e99 100644 --- a/examples/groupchat.c +++ b/examples/groupchat.c @@ -328,7 +328,7 @@ static void parse_command(meshlink_handle_t *mesh, char *buf) { "/who [] List all nodes or show information about the given node.\n" "/listgroup List all nodes in a given group.\n" "/canonical -h -p 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 { diff --git a/src/conf.c b/src/conf.c index e3574ea5..742e81d8 100644 --- a/src/conf.c +++ b/src/conf.c @@ -497,7 +497,7 @@ copy: 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; diff --git a/src/devtools.h b/src/devtools.h index 3c5f9433..97924384 100644 --- a/src/devtools.h +++ b/src/devtools.h @@ -68,7 +68,7 @@ struct devtool_edge { * @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. */ diff --git a/src/discovery.h b/src/discovery.h index 055aa9de..bd034a80 100644 --- a/src/discovery.h +++ b/src/discovery.h @@ -2,7 +2,7 @@ #define MESHLINK_DISCOVERY_H /* - discovery.h -- header for dicovery.c + discovery.h -- header for discovery.c Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify diff --git a/src/fake-getaddrinfo.c b/src/fake-getaddrinfo.c index 9aaddaf8..576d79f4 100644 --- a/src/fake-getaddrinfo.c +++ b/src/fake-getaddrinfo.c @@ -2,10 +2,10 @@ * 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. */ diff --git a/src/fake-getnameinfo.c b/src/fake-getnameinfo.c index 88b78a59..e51bce24 100644 --- a/src/fake-getnameinfo.c +++ b/src/fake-getnameinfo.c @@ -2,10 +2,10 @@ * 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. */ diff --git a/src/meshlink++.h b/src/meshlink++.h index 312b42c8..37ca7e8b 100644 --- a/src/meshlink++.h +++ b/src/meshlink++.h @@ -147,7 +147,7 @@ public: * @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); @@ -213,7 +213,7 @@ public: (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 @@ -279,7 +279,7 @@ public: /** 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); @@ -507,7 +507,7 @@ public: * 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); @@ -543,7 +543,7 @@ public: /// 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. * @@ -792,7 +792,7 @@ static inline const char *strerror(errno_t err = meshlink_errno) { * @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); diff --git a/src/meshlink.c b/src/meshlink.c index 9faccff4..474cef08 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -922,7 +922,7 @@ static bool invitation_receive(void *handle, uint8_t type, const void *msg, uint 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; @@ -3136,7 +3136,7 @@ ssize_t meshlink_channel_send(meshlink_handle_t *mesh, meshlink_channel_t *chann // 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); diff --git a/src/meshlink.h b/src/meshlink.h index b4fb16c9..9c800ab8 100644 --- a/src/meshlink.h +++ b/src/meshlink.h @@ -66,7 +66,7 @@ typedef enum { 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 @@ -101,7 +101,7 @@ static const uint32_t MESHLINK_CHANNEL_UDP = 0; // Select UDP semantics. /** 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; @@ -237,7 +237,7 @@ meshlink_submesh_t *meshlink_submesh_open(meshlink_handle_t *mesh, const char * * * @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); @@ -273,7 +273,7 @@ extern void meshlink_close(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); @@ -697,7 +697,7 @@ extern int meshlink_get_port(meshlink_handle_t *mesh); * 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); @@ -750,7 +750,7 @@ extern char *meshlink_invite(meshlink_handle_t *mesh, meshlink_submesh_t *submes /// 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. * diff --git a/src/net_packet.c b/src/net_packet.c index 857f00fa..d20ea018 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -424,7 +424,7 @@ bool receive_sptps_record(void *handle, uint8_t type, const void *data, uint16_t 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; diff --git a/src/protocol_auth.c b/src/protocol_auth.c index 7f00da2b..f88aaf4b 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -186,7 +186,7 @@ static bool finalize_invitation(meshlink_handle_t *mesh, connection_t *c, const 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 @@ -339,7 +339,7 @@ static bool receive_invitation_sptps(void *handle, uint8_t type, const void *dat 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; } diff --git a/src/protocol_misc.c b/src/protocol_misc.c index d0401b93..8855d20e 100644 --- a/src/protocol_misc.c +++ b/src/protocol_misc.c @@ -89,7 +89,7 @@ bool pong_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { (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; diff --git a/src/route.c b/src/route.c index f7a728dc..91bd2f82 100644 --- a/src/route.c +++ b/src/route.c @@ -45,14 +45,14 @@ void route(meshlink_handle_t *mesh, node_t *source, vpn_packet_t *packet) { 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; } diff --git a/src/xalloc.h b/src/xalloc.h index d9f63e05..948723e3 100644 --- a/src/xalloc.h +++ b/src/xalloc.h @@ -2,7 +2,7 @@ #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 This program is free software; you can redistribute it and/or modify diff --git a/test/blackbox/common/containers.c b/test/blackbox/common/containers.c index 99cdbdfe..ba4b393e 100644 --- a/test/blackbox/common/containers.c +++ b/test/blackbox/common/containers.c @@ -510,7 +510,7 @@ void change_ip(int node) { 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]); } diff --git a/test/blackbox/common/mesh_event_handler.h b/test/blackbox/common/mesh_event_handler.h index e21ef508..609b1cf0 100644 --- a/test/blackbox/common/mesh_event_handler.h +++ b/test/blackbox/common/mesh_event_handler.h @@ -118,7 +118,7 @@ extern char *mesh_event_sock_create(const char *ifname); * @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); @@ -131,7 +131,7 @@ 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. diff --git a/test/blackbox/run_blackbox_tests/test_cases_sign.c b/test/blackbox/run_blackbox_tests/test_cases_sign.c index c120c475..11494549 100644 --- a/test/blackbox/run_blackbox_tests/test_cases_sign.c +++ b/test/blackbox/run_blackbox_tests/test_cases_sign.c @@ -143,7 +143,7 @@ static bool test_sign_02(void) { 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; } @@ -187,7 +187,7 @@ static bool test_sign_03(void) { 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"); @@ -233,7 +233,7 @@ static bool test_sign_04(void) { 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; } @@ -279,7 +279,7 @@ static bool test_sign_05(void) { 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; } @@ -324,7 +324,7 @@ static bool test_sign_06(void) { 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; } @@ -370,7 +370,7 @@ static bool test_sign_07(void) { 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; } diff --git a/test/blackbox/run_blackbox_tests/test_cases_submesh02.c b/test/blackbox/run_blackbox_tests/test_cases_submesh02.c index 018adbf8..13c87d0d 100644 --- a/test/blackbox/run_blackbox_tests/test_cases_submesh02.c +++ b/test/blackbox/run_blackbox_tests/test_cases_submesh02.c @@ -143,8 +143,8 @@ static void test_case_submesh_02(void **state) { 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; diff --git a/test/blackbox/run_blackbox_tests/test_cases_verify.c b/test/blackbox/run_blackbox_tests/test_cases_verify.c index e7317477..ad84563e 100644 --- a/test/blackbox/run_blackbox_tests/test_cases_verify.c +++ b/test/blackbox/run_blackbox_tests/test_cases_verify.c @@ -120,7 +120,7 @@ bool test_verify_01(void) { return false; } - PRINT_TEST_CASE_MSG("meshlink_verify Successfuly verified data\n"); + PRINT_TEST_CASE_MSG("meshlink_verify Successfully verified data\n"); return true; } @@ -161,7 +161,7 @@ bool test_verify_02(void) { 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; } diff --git a/test/blackbox/test_case_meta_conn_04/node_sim_nut.c b/test/blackbox/test_case_meta_conn_04/node_sim_nut.c index 358eadcd..04b6d9c9 100644 --- a/test/blackbox/test_case_meta_conn_04/node_sim_nut.c +++ b/test/blackbox/test_case_meta_conn_04/node_sim_nut.c @@ -99,7 +99,7 @@ int main(int argc, char *argv[]) { } 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); diff --git a/test/blackbox/test_case_meta_conn_05/node_sim_nut.c b/test/blackbox/test_case_meta_conn_05/node_sim_nut.c index e0459e09..0a014e83 100644 --- a/test/blackbox/test_case_meta_conn_05/node_sim_nut.c +++ b/test/blackbox/test_case_meta_conn_05/node_sim_nut.c @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) { 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); diff --git a/test/blackbox/test_case_optimal_pmtu_01/node_sim_nut.c b/test/blackbox/test_case_optimal_pmtu_01/node_sim_nut.c index 1b8083b7..40c9a031 100644 --- a/test/blackbox/test_case_optimal_pmtu_01/node_sim_nut.c +++ b/test/blackbox/test_case_optimal_pmtu_01/node_sim_nut.c @@ -203,7 +203,7 @@ static void meshlink_logger(meshlink_handle_t *mesh, meshlink_log_level_t level, 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; diff --git a/test/blackbox/test_case_optimal_pmtu_07/node_sim_nut.c b/test/blackbox/test_case_optimal_pmtu_07/node_sim_nut.c index 75194bb9..dd1320ae 100644 --- a/test/blackbox/test_case_optimal_pmtu_07/node_sim_nut.c +++ b/test/blackbox/test_case_optimal_pmtu_07/node_sim_nut.c @@ -208,7 +208,7 @@ void meshlink_logger(meshlink_handle_t *mesh, meshlink_log_level_t level, 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; -- 2.39.2