Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
net_recon.c File Reference
#include <stdlib.h>
#include <string.h>
#include "ev_mgr.h"
#include "net_recon.h"
#include "utils/rlutil.h"
#include "utils/teo_memory.h"

Macros

#define MODULE   _ANSI_GREEN "net_reconnect" _ANSI_NONE
 
#define kev   ((ksnetEvMgrClass*)kcor->ke)
 
#define kcor
 
#define karp   kcor->ka
 
#define kcor   ((ksnCoreClass*)(((ksnCommandClass*)this->kco)->kc))
 
#define kcom   ((ksnCommandClass*)this->kco)
 
#define karp   ((ksnCoreClass*)kcom->kc)->ka
 
#define kev_
 

Typedefs

typedef struct reconnect_map_data reconnect_map_data
 Reconnect command map data structure. More...
 

Functions

int send_cmd_connected_cb (ksnetArpClass *ka, char *name, ksnet_arp_data *arp_data, void *data)
 Send command connected to peer. More...
 
ksnReconnectClassksnReconnectInit (void *kco)
 Initialize ksnReconnectClass. More...
 

Detailed Description

Author
Kirill Scherba kiril.nosp@m.l@sc.nosp@m.herba.nosp@m..ru

Teonet reconnect module.

Reconnect to disconnected peer

CMD_RECONNECT

When disconnect from peer (not r-host peer):

  • Story disconnected host in reconnect table
  • Ask r-host to reconnect (send reconnect command)
  • Wait for connected to peer or wait signal from r-host (peer does not exists)
    • Resend reconnect command if not connected and r-host signal has not received during timeout
    • Remove "disconnected host" from "reconnect table" and exit

Created on November 5, 2015, 11:19 AM

Macro Definition Documentation

#define karp   kcor->ka
#define karp   ((ksnCoreClass*)kcom->kc)->ka
#define kcom   ((ksnCommandClass*)this->kco)
#define kcor
Value:
map_data->kr->kco)->kc)
KSNet mesh core data.
Definition: net_core.h:38
#define kc
Definition: hotkeys.c:72
KSNet command class data.
Definition: net_com.h:95
#define kcor   ((ksnCoreClass*)(((ksnCommandClass*)this->kco)->kc))
#define kev   ((ksnetEvMgrClass*)kcor->ke)
#define kev_
Value:
(((ksnCommandClass*)kco)->kc))->ke)
KSNet mesh core data.
Definition: net_core.h:38
KSNet event manager functions data.
Definition: ev_mgr.h:245
KSNet command class data.
Definition: net_com.h:95

Referenced by ksnReconnectInit().

#define MODULE   _ANSI_GREEN "net_reconnect" _ANSI_NONE

Referenced by ksnReconnectInit().

Typedef Documentation

typedef struct reconnect_map_data reconnect_map_data

Reconnect command map data structure.

Function Documentation

ksnReconnectClass* ksnReconnectInit ( void *  kco)

Initialize ksnReconnectClass.

Parameters
kcoPointer to ksnCommandClass
Returns

References DEBUG_VV, kev_, ksn_puts, MODULE, and teo_malloc().

Referenced by ksnCommandInit().

int send_cmd_connected_cb ( ksnetArpClass ka,
char *  child_peer,
ksnet_arp_data *  arp_data,
void *  data 
)

Send command connected to peer.

Parameters
kaPointer to ksnetArpClass
child_peerChild peer name
arp_dataChild arp data
dataPointer to ksnCoreRecvData (included new peer name)

References ksnetArpClass::ke, ksnCommandSendCmdConnect(), new_peer, and rd.