tinydtls  0.8.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Data Structures | Typedefs | Enumerations | Functions
peer.h File Reference

information about peers in a DTLS session More...

#include <sys/types.h>
#include "tinydtls.h"
#include "global.h"
#include "session.h"
#include "state.h"
#include "crypto.h"
#include "uthash.h"

Go to the source code of this file.

Data Structures

struct  dtls_peer_t
 

Typedefs

typedef struct dtls_peer_t dtls_peer_t
 

Enumerations

enum  dtls_peer_type { DTLS_CLIENT =0, DTLS_SERVER }
 

Functions

static dtls_security_parameters_tdtls_security_params_epoch (dtls_peer_t *peer, uint16_t epoch)
 
static dtls_security_parameters_tdtls_security_params (dtls_peer_t *peer)
 
static dtls_security_parameters_tdtls_security_params_next (dtls_peer_t *peer)
 
static void dtls_security_params_free_other (dtls_peer_t *peer)
 
static void dtls_security_params_switch (dtls_peer_t *peer)
 
void peer_init ()
 
dtls_peer_tdtls_new_peer (const session_t *session)
 
void dtls_free_peer (dtls_peer_t *peer)
 
static dtls_state_t dtls_peer_state (const dtls_peer_t *peer)
 
static int dtls_peer_is_connected (const dtls_peer_t *peer)
 

Detailed Description

information about peers in a DTLS session

Definition in file peer.h.

Typedef Documentation

typedef struct dtls_peer_t dtls_peer_t

Holds security parameters, local state and the transport address for each peer.

Enumeration Type Documentation

Enumerator
DTLS_CLIENT 
DTLS_SERVER 

Definition at line 47 of file peer.h.

Function Documentation

void dtls_free_peer ( dtls_peer_t peer)

Releases the storage allocated to peer.

Definition at line 41 of file peer.c.

dtls_peer_t* dtls_new_peer ( const session_t session)

Creates a new peer for given session. The current configuration is initialized with the cipher suite TLS_NULL_WITH_NULL_NULL (i.e. no security at all). This function returns a pointer to the new peer or NULL on error. The caller is responsible for releasing the storage allocated for this peer using dtls_free_peer().

Parameters
sessionThe remote peer's address and local interface index.
Returns
A pointer to a newly created and initialized peer object or NULL on error.

Definition at line 72 of file peer.c.

static int dtls_peer_is_connected ( const dtls_peer_t peer)
inlinestatic

Checks if given peer is connected. This function returns 1 if connected, or 0 otherwise.

Definition at line 144 of file peer.h.

static dtls_state_t dtls_peer_state ( const dtls_peer_t peer)
inlinestatic

Returns the current state of peer.

Definition at line 136 of file peer.h.

static dtls_security_parameters_t* dtls_security_params ( dtls_peer_t peer)
inlinestatic

Definition at line 79 of file peer.h.

static dtls_security_parameters_t* dtls_security_params_epoch ( dtls_peer_t peer,
uint16_t  epoch 
)
inlinestatic

Definition at line 68 of file peer.h.

static void dtls_security_params_free_other ( dtls_peer_t peer)
inlinestatic

Definition at line 97 of file peer.h.

static dtls_security_parameters_t* dtls_security_params_next ( dtls_peer_t peer)
inlinestatic

Definition at line 84 of file peer.h.

static void dtls_security_params_switch ( dtls_peer_t peer)
inlinestatic

Definition at line 109 of file peer.h.

void peer_init ( )

Definition at line 31 of file peer.c.