From c00cf85078a3d0ba372dc95d9ca1f54007d10ba5 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Mon, 8 Jul 2013 12:36:11 -0400 Subject: Spelling mistakes fixed. --- core/DHT.c | 6 +++--- core/DHT.h | 2 +- core/Lossless_UDP.c | 16 ++++++++-------- core/Lossless_UDP.h | 2 +- core/net_crypto.c | 22 +++++++++++----------- core/net_crypto.h | 12 ++++++------ core/network.c | 2 +- core/network.h | 4 ++-- 8 files changed, 33 insertions(+), 33 deletions(-) (limited to 'core') diff --git a/core/DHT.c b/core/DHT.c index 31a3fad3..5ca3604f 100644 --- a/core/DHT.c +++ b/core/DHT.c @@ -246,7 +246,7 @@ int get_close_nodes(uint8_t * client_id, Node_format * nodes_list) //replace first bad (or empty) node with this one -//return 0 if successfull +//return 0 if successful //return 1 if not (list contains no bad nodes) int replace_bad(Client_data * list, uint32_t length, uint8_t * client_id, IP_Port ip_port)//tested { @@ -291,7 +291,7 @@ void addto_lists(IP_Port ip_port, uint8_t * client_id) { uint32_t i; - //NOTE: current behaviour if there are two clients with the same id is to only keep one (the first one) + //NOTE: current behavior if there are two clients with the same id is to only keep one (the first one) if(!client_in_list(close_clientlist, LCLIENT_LIST, client_id, ip_port)) { @@ -548,7 +548,7 @@ int sendnodes(IP_Port ip_port, uint8_t * client_id, uint32_t ping_id) //Packet handling functions -//One to handle each types of packets we recieve +//One to handle each types of packets we receive //return 0 if handled correctly, 1 if packet is bad. int handle_pingreq(uint8_t * packet, uint32_t length, IP_Port source)//tested { diff --git a/core/DHT.h b/core/DHT.h index 87794e63..0290ef92 100644 --- a/core/DHT.h +++ b/core/DHT.h @@ -62,7 +62,7 @@ IP_Port DHT_getfriendip(uint8_t * client_id); //Run this function at least a couple times per second (It's the main loop) void doDHT(); -//if we recieve a DHT packet we call this function so it can be handled. +//if we receive a DHT packet we call this function so it can be handled. //Return 0 if packet is handled correctly. //return 1 if it didn't handle the packet or if the packet was shit. int DHT_handlepacket(uint8_t * packet, uint32_t length, IP_Port source); diff --git a/core/Lossless_UDP.c b/core/Lossless_UDP.c index b249760a..080dc821 100644 --- a/core/Lossless_UDP.c +++ b/core/Lossless_UDP.c @@ -27,7 +27,7 @@ -//maximum data packets in sent and recieve queues. +//maximum data packets in sent and receive queues. #define MAX_QUEUE_NUM 16 //maximum length of the data in the data packets @@ -66,14 +66,14 @@ typedef struct uint16_t data_rate;//current data packet send rate packets per second. uint64_t last_SYNC; //time at which our last SYNC packet was sent. uint64_t last_sent; //time at which our last data or handshake packet was sent. - uint64_t last_recv; //time at which we last recieved something from the other + uint64_t last_recv; //time at which we last received something from the other uint64_t killat; //time at which to kill the connection Data sendbuffer[MAX_QUEUE_NUM];//packet send buffer. - Data recvbuffer[MAX_QUEUE_NUM];//packet recieve buffer. + Data recvbuffer[MAX_QUEUE_NUM];//packet receive buffer. uint32_t handshake_id1; uint32_t handshake_id2; - uint32_t recv_packetnum; //number of data packets recieved (also used as handshake_id1) - uint32_t orecv_packetnum; //number of packets recieved by the other peer + uint32_t recv_packetnum; //number of data packets received (also used as handshake_id1) + uint32_t orecv_packetnum; //number of packets received by the other peer uint32_t sent_packetnum; //number of data packets sent uint32_t osent_packetnum; //number of packets sent by the other peer. uint32_t sendbuff_packetnum; //number of latest packet written onto the sendbuffer @@ -250,7 +250,7 @@ int kill_connection_in(int connection_id, uint32_t seconds) //return 1 if attempting handshake //return 2 if handshake is done //return 3 if fully connected -//return 4 if timed out and wating to be killed +//return 4 if timed out and waiting to be killed int is_connected(int connection_id) { if(connection_id >= 0 && connection_id < MAX_CONNECTIONS) @@ -450,7 +450,7 @@ int send_DATA(uint32_t connection_id) //Packet handling functions -//One to handle each type of packets we recieve +//One to handle each type of packets we receive //return 0 if handled correctly, 1 if packet is bad. int handle_handshake(uint8_t * packet, uint32_t length, IP_Port source) { @@ -607,7 +607,7 @@ int handle_SYNC(uint8_t * packet, uint32_t length, IP_Port source) return 0; } -//add a packet to the recieved buffer and set the recv_packetnum of the connection to its proper value. +//add a packet to the received buffer and set the recv_packetnum of the connection to its proper value. //return 1 if data was too big, 0 if not. int add_recv(int connection_id, uint32_t data_num, uint8_t * data, uint16_t size) { diff --git a/core/Lossless_UDP.h b/core/Lossless_UDP.h index 18224088..ad8c545c 100644 --- a/core/Lossless_UDP.h +++ b/core/Lossless_UDP.h @@ -69,7 +69,7 @@ IP_Port connection_ip(int connection_id); char id_packet(int connection_id); //return 0 if there is no received data in the buffer. -//return length of recieved packet if successful +//return length of received packet if successful int read_packet(int connection_id, uint8_t * data); diff --git a/core/net_crypto.c b/core/net_crypto.c index 3a3785ff..980250d0 100644 --- a/core/net_crypto.c +++ b/core/net_crypto.c @@ -36,13 +36,13 @@ uint8_t self_secret_key[crypto_box_SECRETKEYBYTES]; typedef struct { uint8_t public_key[crypto_box_PUBLICKEYBYTES];//the real public key of the peer. - uint8_t recv_nonce[crypto_box_NONCEBYTES];//nonce of recieved packets + uint8_t recv_nonce[crypto_box_NONCEBYTES];//nonce of received packets uint8_t sent_nonce[crypto_box_NONCEBYTES];//nonce of sent packets. uint8_t sessionpublic_key[crypto_box_PUBLICKEYBYTES];//our public key for this session. uint8_t sessionsecret_key[crypto_box_SECRETKEYBYTES];//our private key for this session. uint8_t peersessionpublic_key[crypto_box_PUBLICKEYBYTES];//The public key of the peer. uint8_t status;//0 if no connection, 1 we have sent a handshake, 2 if connexion is not confirmed yet - //(we have recieved a hanshake but no empty data packet), 3 if the connection is established. + //(we have received a handshake but no empty data packet), 3 if the connection is established. //4 if the connection is timed out. uint16_t number; //Lossless_UDP connection number corresponding to this connection. @@ -63,7 +63,7 @@ int outbound_friendrequests[MAX_FRIEND_REQUESTS]; int incoming_connections[MAX_INCOMING]; //encrypts plain of length length to encrypted of length + 16 using the -//public key(32 bytes) of the reciever and the secret key of the sender and a 24 byte nonce +//public key(32 bytes) of the receiver and the secret key of the sender and a 24 byte nonce //return -1 if there was a problem. //return length of encrypted data if everything was fine. int encrypt_data(uint8_t * public_key, uint8_t * secret_key, uint8_t * nonce, @@ -93,7 +93,7 @@ int encrypt_data(uint8_t * public_key, uint8_t * secret_key, uint8_t * nonce, } //decrypts encrypted of length length to plain of length length - 16 using the -//public key(32 bytes) of the sender, the secret key of the reciever and a 24 byte nonce +//public key(32 bytes) of the sender, the secret key of the receiver and a 24 byte nonce //return -1 if there was a problem(decryption failed) //return length of plain data if everything was fine. int decrypt_data(uint8_t * public_key, uint8_t * secret_key, uint8_t * nonce, @@ -151,7 +151,7 @@ void random_nonce(uint8_t * nonce) //return 0 if there is no received data in the buffer //return -1 if the packet was discarded. -//return length of recieved data if successful +//return length of received data if successful int read_cryptpacket(int crypt_connection_id, uint8_t * data) { if(crypt_connection_id < 0 || crypt_connection_id >= MAX_CRYPTO_CONNECTIONS) @@ -436,7 +436,7 @@ int crypto_connect(uint8_t * public_key, IP_Port ip_port) //handle an incoming connection //return -1 if no crypto inbound connection -//return incomming connection id (Lossless_UDP one) if there is an incomming crypto connection +//return incoming connection id (Lossless_UDP one) if there is an incoming crypto connection //Put the public key of the peer in public_key, the secret_nonce from the handshake into secret_nonce //and the session public key for the connection in session_key //to accept it see: accept_crypto_inbound(...) @@ -524,8 +524,8 @@ int accept_crypto_inbound(int connection_id, uint8_t * public_key, uint8_t * sec } //return 0 if no connection, 1 we have sent a handshake, 2 if connexion is not confirmed yet -//(we have recieved a hanshake but no empty data packet), 3 if the connection is established. -//4 if the connection is timed out and wating to be killed +//(we have received a handshake but no empty data packet), 3 if the connection is established. +//4 if the connection is timed out and waiting to be killed int is_cryptoconnected(int crypt_connection_id) { if(crypt_connection_id >= 0 && crypt_connection_id < MAX_CRYPTO_CONNECTIONS) @@ -580,8 +580,8 @@ void handle_incomings() } } -//handle recieved packets for not yet established crypto connections. -void recieve_crypto() +//handle received packets for not yet established crypto connections. +void receive_crypto() { uint32_t i; for(i = 0; i < MAX_CRYPTO_CONNECTIONS; i++) @@ -678,6 +678,6 @@ void doNetCrypto() //handle new incoming connections //handle friend requests handle_incomings(); - recieve_crypto(); + receive_crypto(); killTimedout(); } diff --git a/core/net_crypto.h b/core/net_crypto.h index a9bf1351..c8837c03 100644 --- a/core/net_crypto.h +++ b/core/net_crypto.h @@ -36,7 +36,7 @@ extern uint8_t self_public_key[crypto_box_PUBLICKEYBYTES]; //encrypts plain of length length to encrypted of length + 16 using the -//public key(32 bytes) of the reciever and the secret key of the sender and a 24 byte nonce +//public key(32 bytes) of the receiver and the secret key of the sender and a 24 byte nonce //return -1 if there was a problem. //return length of encrypted data if everything was fine. int encrypt_data(uint8_t * public_key, uint8_t * secret_key, uint8_t * nonce, @@ -44,7 +44,7 @@ int encrypt_data(uint8_t * public_key, uint8_t * secret_key, uint8_t * nonce, //decrypts encrypted of length length to plain of length length - 16 using the -//public key(32 bytes) of the sender, the secret key of the reciever and a 24 byte nonce +//public key(32 bytes) of the sender, the secret key of the receiver and a 24 byte nonce //return -1 if there was a problem(decryption failed) //return length of plain data if everything was fine. int decrypt_data(uint8_t * public_key, uint8_t * secret_key, uint8_t * nonce, @@ -53,7 +53,7 @@ int decrypt_data(uint8_t * public_key, uint8_t * secret_key, uint8_t * nonce, //return 0 if there is no received data in the buffer //return -1 if the packet was discarded. -//return length of recieved data if successful +//return length of received data if successful int read_cryptpacket(int crypt_connection_id, uint8_t * data); @@ -94,7 +94,7 @@ int crypto_kill(int crypt_connection_id); //handle an incoming connection //return -1 if no crypto inbound connection -//return incomming connection id (Lossless_UDP one) if there is an incomming crypto connection +//return incoming connection id (Lossless_UDP one) if there is an incoming crypto connection //Put the public key of the peer in public_key, the secret_nonce from the handshake into secret_nonce //and the session public key for the connection in session_key //to accept it see: accept_crypto_inbound(...) @@ -108,8 +108,8 @@ int crypto_inbound(uint8_t * public_key, uint8_t * secret_nonce, uint8_t * sessi int accept_crypto_inbound(int connection_id, uint8_t * public_key, uint8_t * secret_nonce, uint8_t * session_key); //return 0 if no connection, 1 we have sent a handshake, 2 if connexion is not confirmed yet -//(we have recieved a hanshake but no empty data packet), 3 if the connection is established. -//4 if the connection is timed out and wating to be killed +//(we have received a handshake but no empty data packet), 3 if the connection is established. +//4 if the connection is timed out and waiting to be killed int is_cryptoconnected(int crypt_connection_id); diff --git a/core/network.c b/core/network.c index 6b5f9970..9693df1c 100644 --- a/core/network.c +++ b/core/network.c @@ -74,7 +74,7 @@ int sendpacket(IP_Port ip_port, uint8_t * data, uint32_t length) //the packet data into data //the packet length into length. //dump all empty packets. -int recievepacket(IP_Port * ip_port, uint8_t * data, uint32_t * length) +int receivepacket(IP_Port * ip_port, uint8_t * data, uint32_t * length) { ADDR addr; #ifdef WIN32 diff --git a/core/network.h b/core/network.h index 9606d237..894bedeb 100644 --- a/core/network.h +++ b/core/network.h @@ -97,10 +97,10 @@ uint32_t random_int(); //Function to send packet(data) of length length to ip_port int sendpacket(IP_Port ip_port, uint8_t * data, uint32_t length); -//Function to recieve data, ip and port of sender is put into ip_port +//Function to receive data, ip and port of sender is put into ip_port //the packet data into data //the packet length into length. -int recievepacket(IP_Port * ip_port, uint8_t * data, uint32_t * length); +int receivepacket(IP_Port * ip_port, uint8_t * data, uint32_t * length); //initialize networking //bind to ip and port -- cgit v1.2.3