X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsptps.h;h=d8ce3dae8d2372def8ad6bce5924a3e82578dd75;hb=153abaa4d940bf2bc9bd7275d5efe5c01c354190;hp=f0d259206ebb5b6ec627834517e195eb6132ece4;hpb=efd21e232dced3225f119aeb7a585ebf55b7cf77;p=tinc diff --git a/src/sptps.h b/src/sptps.h index f0d25920..d8ce3dae 100644 --- a/src/sptps.h +++ b/src/sptps.h @@ -17,6 +17,9 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#ifndef __SPTPS_H__ +#define __SPTPS_H__ + #include "system.h" #include "cipher.h" @@ -37,11 +40,12 @@ #define SPTPS_SIG 2 // Waiting for a SIGnature record #define SPTPS_ACK 3 // Waiting for an ACKnowledgement record -typedef bool (*send_data_t)(void *handle, const char *data, size_t len); +typedef bool (*send_data_t)(void *handle, uint8_t type, const char *data, size_t len); typedef bool (*receive_record_t)(void *handle, uint8_t type, const char *data, uint16_t len); typedef struct sptps { bool initiator; + bool datagram; int state; char *inbuf; @@ -73,8 +77,10 @@ typedef struct sptps { receive_record_t receive_record; } sptps_t; -extern bool start_sptps(sptps_t *s, void *handle, bool initiator, ecdsa_t mykey, ecdsa_t hiskey, const char *label, size_t labellen, send_data_t send_data, receive_record_t receive_record); -extern bool stop_sptps(sptps_t *s); -extern bool send_record(sptps_t *s, uint8_t type, const char *data, uint16_t len); -extern bool receive_data(sptps_t *s, const char *data, size_t len); -extern bool force_kex(sptps_t *s); +extern bool sptps_start(sptps_t *s, void *handle, bool initiator, bool datagram, ecdsa_t mykey, ecdsa_t hiskey, const char *label, size_t labellen, send_data_t send_data, receive_record_t receive_record); +extern bool sptps_stop(sptps_t *s); +extern bool sptps_send_record(sptps_t *s, uint8_t type, const char *data, uint16_t len); +extern bool sptps_receive_data(sptps_t *s, const char *data, size_t len); +extern bool sptps_force_kex(sptps_t *s); + +#endif