Robotran C Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
handshake.c File Reference

Handshake routines. More...

#include <base64.h>
#include <sha1.h>
#include <ws.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Macros

#define _POSIX_C_SOURCE   200809L
 

Functions

int get_handshake_accept (char *wsKey, unsigned char **dest)
 Gets the field Sec-WebSocket-Accept on response, by an previously informed key. More...
 
int get_handshake_response (char *hsrequest, char **hsresponse)
 Gets the complete response to accomplish a succesfully handshake. More...
 

Detailed Description

Handshake routines.

Macro Definition Documentation

◆ _POSIX_C_SOURCE

#define _POSIX_C_SOURCE   200809L

Function Documentation

◆ get_handshake_accept()

int get_handshake_accept ( char *  wsKey,
unsigned char **  dest 
)

Gets the field Sec-WebSocket-Accept on response, by an previously informed key.

Parameters
wsKeySec-WebSocket-Key
destsource to be stored the value.
Returns
Returns 0 if success and a negative number otherwise.
Attention
This is part of the internal API and is documented just for completeness.

◆ get_handshake_response()

int get_handshake_response ( char *  hsrequest,
char **  hsresponse 
)

Gets the complete response to accomplish a succesfully handshake.

Parameters
hsrequestClient request.
hsresponseServer response.
Returns
Returns 0 if success and a negative number otherwise.
Attention
This is part of the internal API and is documented just for completeness.