Project Alice
Loading...
Searching...
No Matches
pcp_event_handler.c File Reference
#include "default_config.h"
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <time.h>
#include <assert.h>
#include <sys/socket.h>
#include <sys/select.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include "pcp.h"
#include "pcp_utils.h"
#include "pcp_msg.h"
#include "pcp_msg_structs.h"
#include "pcp_logger.h"
#include "pcp_event_handler.h"
#include "pcp_server_discovery.h"
#include "net/pcp_socket.h"
Include dependency graph for pcp_event_handler.c:

Go to the source code of this file.

Classes

struct  pcp_flow_state_trans
 
struct  pcp_flow_state_event
 
struct  get_first_flow_iter_data
 
struct  flow_iterator_data
 
struct  pcp_server_state_machine
 
struct  hserver_iter_data
 

Macros

#define MIN(a, b)   (a<b?a:b)
 
#define MAX(a, b)   (a>b?a:b)
 
#define PCP_RT(rtprev)
 
#define FLOW_TRANS_COUNT   (sizeof(flow_transitions)/sizeof(*flow_transitions))
 
#define FLOW_EVENTS_SM_COUNT   (sizeof(flow_events_sm)/sizeof(*flow_events_sm))
 
#define SERVER_STATE_MACHINE_COUNT   (sizeof(server_sm)/sizeof(*server_sm))
 

Typedefs

typedef pcp_flow_event_e(* handle_flow_state_event) (pcp_flow_t *f, pcp_recv_msg_t *msg)
 
typedef struct pcp_flow_state_trans pcp_flow_state_trans_t
 
typedef struct pcp_flow_state_event pcp_flow_state_events_t
 
typedef pcp_server_state_e(* handle_server_state_event) (pcp_server_t *s)
 
typedef struct pcp_server_state_machine pcp_server_state_machine_t
 

Functions

pcp_errno run_server_state_machine (pcp_server_t *s, pcp_event_e event)
 
int pcp_pulse (pcp_ctx_t *ctx, struct timeval *next_timeout)
 
void pcp_flow_updated (pcp_flow_t *f)
 
void pcp_set_flow_change_cb (pcp_ctx_t *ctx, pcp_flow_change_notify cb_fun, void *cb_arg)
 

Macro Definition Documentation

◆ FLOW_EVENTS_SM_COUNT

#define FLOW_EVENTS_SM_COUNT   (sizeof(flow_events_sm)/sizeof(*flow_events_sm))

Definition at line 174 of file pcp_event_handler.c.

◆ FLOW_TRANS_COUNT

#define FLOW_TRANS_COUNT   (sizeof(flow_transitions)/sizeof(*flow_transitions))

Definition at line 118 of file pcp_event_handler.c.

◆ MAX

#define MAX (   a,
 
)    (a>b?a:b)

Definition at line 66 of file pcp_event_handler.c.

◆ MIN

#define MIN (   a,
 
)    (a<b?a:b)

Definition at line 63 of file pcp_event_handler.c.

◆ PCP_RT

#define PCP_RT (   rtprev)
Value:
((rtprev=rtprev<<1),(((8192+(1024-(rand()&2047))) \
* MIN (MAX(rtprev,PCP_RETX_IRT), PCP_RETX_MRT))>>13))
#define PCP_RETX_MRT
#define PCP_RETX_IRT
#define MIN(a, b)
#define MAX(a, b)

Definition at line 68 of file pcp_event_handler.c.

◆ SERVER_STATE_MACHINE_COUNT

#define SERVER_STATE_MACHINE_COUNT   (sizeof(server_sm)/sizeof(*server_sm))

Definition at line 1001 of file pcp_event_handler.c.

Typedef Documentation

◆ handle_flow_state_event

typedef pcp_flow_event_e(* handle_flow_state_event) (pcp_flow_t *f, pcp_recv_msg_t *msg)

Definition at line 98 of file pcp_event_handler.c.

◆ handle_server_state_event

typedef pcp_server_state_e(* handle_server_state_event) (pcp_server_t *s)

Definition at line 961 of file pcp_event_handler.c.

◆ pcp_flow_state_events_t

◆ pcp_flow_state_trans_t

◆ pcp_server_state_machine_t

Function Documentation

◆ pcp_flow_updated()

void pcp_flow_updated ( pcp_flow_t f)

Definition at line 1147 of file pcp_event_handler.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcp_pulse()

int pcp_pulse ( pcp_ctx_t ctx,
struct timeval *  next_timeout 
)

Definition at line 1087 of file pcp_event_handler.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcp_set_flow_change_cb()

void pcp_set_flow_change_cb ( pcp_ctx_t ctx,
pcp_flow_change_notify  cb_fun,
void *  cb_arg 
)

Definition at line 1168 of file pcp_event_handler.c.

◆ run_server_state_machine()

pcp_errno run_server_state_machine ( pcp_server_t s,
pcp_event_e  event 
)

Definition at line 1003 of file pcp_event_handler.c.

Here is the caller graph for this function: