Last active
August 29, 2015 13:57
-
-
Save AlexsJones/9462395 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __CONNECTION_CONTROL_H__ | |
#define __CONNECTION_CONTROL_H__ | |
typedef enum cstate { PRECONNECTION, HANDSHAKING, ENCRYPTING, DECRYPTING, SENDING }; | |
typedef struct connection_state { | |
raw_peer *local; //raw peer will contain an RSA keypair | |
raw_peer *foreign; //foreign peer will contain half an RSA keypair | |
char *shared_secret; | |
cstate state; | |
} connection_state; | |
connection_state* connectioncontrol_setup(connection_state *cs); | |
void connectioncontrol_stop(connection_state *cs); | |
void connectioncontrol_start(raw_peer *cA,raw_peer *cB); | |
int connectioncontrol_isconnected(connection_state *cs); | |
int connectioncontrol_secure_message(connection_state *cs,char *msg); | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment