VCOM Linux Driver
Advantech Inc.
Loading...
Searching...
No Matches
vcom.h File Reference
#include <time.h>
#include <stdarg.h>
#include "advvcom.h"
#include "vcom_proto.h"
#include "vcom_monitor_dbg.h"

Go to the source code of this file.

Data Structures

struct  stk_vc
 
struct  vc_attr
 
struct  vc_ops
 

Macros

#define VC_PULL_TIME   10000000
 
#define VC_PULL_PSEC   (VC_PULL_TIME / 1000000)
 
#define VC_PULL_PUSEC   (VC_PULL_TIME % 1000000)
 
#define CONN_TO   10
 
#define VC_TIME_USED(a)
 
#define STACK_MAX   10
 
#define stk_full(a)
 
#define stk_empty(a)
 
#define stk_bot(a)
 
#define ATTR_SAME   0
 
#define ATTR_DIFF   1
 
#define attr_p(a, b)
 
#define eki_p(a, b)
 
#define check_attr_stat(a, b)
 
#define update_eki_attr(a, b, c)
 
#define try_ops1(a, b, c)
 
#define try_ops2(a, b, c, d)
 
#define try_ops3(a, b, c, d, e)
 
#define try_ops4(a, b, c, d, e, f)
 
#define try_ops5(a, b, c, d, e, f, g)
 
#define try_ovrld(_1, _2, _3, _4, _5, _6, _7, func, ...)
 
#define try_ops(args...)
 
#define mon_update(...)
 
#define mon_init(a)
 
#define mon_update_check(...)
 
#define EXCP_SLEEPTIME   3
 
#define EXCP_RECONN_TIME   5
 
#define INO_PUSH_SWITCH   0
 
#define INO_POP_SWITCH   0
 
#define INO_RPLS_SWITCH   0
 
#define INO_RESTART_SWITCH   0
 
#define _expmsg_extra(msg, len, ...)
 
#define stk_push(a, b)
 
#define stk_pop(a)
 
#define stk_excp(a, ...)
 
#define stk_rpls(a, b)
 
#define stk_restart(a)
 
#define VC_SKOPT_BLOCK   0
 
#define VC_SKOPT_NONBLOCK   1
 
#define VC_SKOPT_ENKALIVE   2
 
#define VC_SKOPT_DISKALIVE   3
 
#define OPT_ISMATCH(OPT, TMP)
 
#define VC_MAX_SKNUM   16
 
#define VC_PROTO_PORT   5202
 
#define VC_SSL_PROXY   5555
 
#define FD_RD_RDY   1
 
#define FD_WR_RDY   2
 
#define FD_EX_RDY   4
 
#define VC_BUF_RX   0
 
#define VC_BUF_TX   1
 
#define VC_BUF_ATTR   2
 

Variables

void * stk_mon
 
struct vc_ops vc_netdown_ops
 
struct vc_ops vc_netup_ops
 

Macro Definition Documentation

◆ _expmsg_extra

#define _expmsg_extra ( msg,
len,
... )
Value:
do{ int r; if(stk->top >= 0) {\
_Pragma("GCC diagnostic ignored \"-Wformat-zero-length\"")\
r= snprintf(msg, len, "(%s)%s,%d:", stk->stk_stat[stk->top]->name(), \
__func__, __LINE__); \
snprintf(&msg[r],len -r, "" __VA_ARGS__);\
}else{ \
r= snprintf(msg, len, "(NULL)%s,%d:", __func__, __LINE__ ); \
snprintf(&msg[r],len -r, "" __VA_ARGS__);\
}\
_Pragma("GCC diagnostic warning \"-Wformat-zero-length\"")\
}while(0)
unsigned short len
Definition vcom_proto.h:3

◆ ATTR_DIFF

#define ATTR_DIFF   1

◆ attr_p

#define attr_p ( a,
b )
Value:
(((a)->attr[(a)->attr_ptr]).b)

◆ ATTR_SAME

#define ATTR_SAME   0

◆ check_attr_stat

#define check_attr_stat ( a,
b )
Value:
(attr_p(a, b) == eki_p(a, b)?ATTR_SAME:ATTR_DIFF)
#define attr_p(a, b)
Definition vcom.h:53
#define ATTR_SAME
Definition vcom.h:51
#define ATTR_DIFF
Definition vcom.h:52
#define eki_p(a, b)
Definition vcom.h:54

◆ CONN_TO

#define CONN_TO   10

◆ eki_p

#define eki_p ( a,
b )
Value:
((a)->eki.b)

◆ EXCP_RECONN_TIME

#define EXCP_RECONN_TIME   5

◆ EXCP_SLEEPTIME

#define EXCP_SLEEPTIME   3

◆ FD_EX_RDY

#define FD_EX_RDY   4

◆ FD_RD_RDY

#define FD_RD_RDY   1

◆ FD_WR_RDY

#define FD_WR_RDY   2

◆ INO_POP_SWITCH

#define INO_POP_SWITCH   0

◆ INO_PUSH_SWITCH

#define INO_PUSH_SWITCH   0

◆ INO_RESTART_SWITCH

#define INO_RESTART_SWITCH   0

◆ INO_RPLS_SWITCH

#define INO_RPLS_SWITCH   0

◆ mon_init

#define mon_init ( a)
Value:
do{}while(0)

◆ mon_update

#define mon_update ( ...)
Value:
do{}while(0)

◆ mon_update_check

#define mon_update_check ( ...)
Value:
do{}while(0)

◆ OPT_ISMATCH

#define OPT_ISMATCH ( OPT,
TMP )
Value:
(OPT==TMP?1:0)

◆ STACK_MAX

#define STACK_MAX   10

◆ stk_bot

#define stk_bot ( a)
Value:
((a)->top==0)

◆ stk_empty

#define stk_empty ( a)
Value:
((a)->top<0)

◆ stk_excp

#define stk_excp ( a,
... )
Value:
do{char msg[256]; _expmsg_extra(msg, sizeof(msg),\
__VA_ARGS__);\
_stk_excp(a, msg);}while(0)
#define _expmsg_extra(msg, len,...)
Definition vcom.h:150

◆ stk_full

#define stk_full ( a)
Value:
((a)->top>=STACK_MAX-1)
#define STACK_MAX
Definition vcom.h:21

◆ stk_pop

#define stk_pop ( a)
Value:
_stk_pop(a)

◆ stk_push

#define stk_push ( a,
b )
Value:
_stk_push(a, b)

◆ stk_restart

#define stk_restart ( a)
Value:
_stk_restart(a)

◆ stk_rpls

#define stk_rpls ( a,
b )
Value:
_stk_rpls(a, b)

◆ try_ops

#define try_ops ( args...)
Value:
,...)(args)
#define try_ovrld(_1, _2, _3, _4, _5, _6, _7, func,...)
Definition vcom.h:79
#define try_ops2(a, b, c, d)
Definition vcom.h:74
#define try_ops5(a, b, c, d, e, f, g)
Definition vcom.h:77
#define try_ops1(a, b, c)
Definition vcom.h:73
#define try_ops4(a, b, c, d, e, f)
Definition vcom.h:76
#define try_ops3(a, b, c, d, e)
Definition vcom.h:75

◆ try_ops1

#define try_ops1 ( a,
b,
c )
Value:
(((a)->b > 0)?(a)->b(c):a)

◆ try_ops2

#define try_ops2 ( a,
b,
c,
d )
Value:
(((a)->b > 0)?(a)->b(c, d):a)

◆ try_ops3

#define try_ops3 ( a,
b,
c,
d,
e )
Value:
(((a)->b > 0)?(a)->b(c, d, e):a)

◆ try_ops4

#define try_ops4 ( a,
b,
c,
d,
e,
f )
Value:
(((a)->b > 0)?(a)->b(c, d, e, f):a)

◆ try_ops5

#define try_ops5 ( a,
b,
c,
d,
e,
f,
g )
Value:
(((a)->b > 0)?(a)->b(c, d, e, f, g):a)

◆ try_ovrld

#define try_ovrld ( _1,
_2,
_3,
_4,
_5,
_6,
_7,
func,
... )
Value:
func

◆ update_eki_attr

#define update_eki_attr ( a,
b,
c )
Value:
do{eki_p(a, b) = c;}while(0)

◆ VC_BUF_ATTR

#define VC_BUF_ATTR   2

◆ VC_BUF_RX

#define VC_BUF_RX   0

◆ VC_BUF_TX

#define VC_BUF_TX   1

◆ VC_MAX_SKNUM

#define VC_MAX_SKNUM   16

◆ VC_PROTO_PORT

#define VC_PROTO_PORT   5202

◆ VC_PULL_PSEC

#define VC_PULL_PSEC   (VC_PULL_TIME / 1000000)

◆ VC_PULL_PUSEC

#define VC_PULL_PUSEC   (VC_PULL_TIME % 1000000)

◆ VC_PULL_TIME

#define VC_PULL_TIME   10000000

◆ VC_SKOPT_BLOCK

#define VC_SKOPT_BLOCK   0

◆ VC_SKOPT_DISKALIVE

#define VC_SKOPT_DISKALIVE   3

◆ VC_SKOPT_ENKALIVE

#define VC_SKOPT_ENKALIVE   2

◆ VC_SKOPT_NONBLOCK

#define VC_SKOPT_NONBLOCK   1

◆ VC_SSL_PROXY

#define VC_SSL_PROXY   5555

◆ VC_TIME_USED

#define VC_TIME_USED ( a)
Value:
(VC_PULL_TIME - (a.tv_sec * 1000000 + a.tv_usec));
#define VC_PULL_TIME
Definition vcom.h:14

Variable Documentation

◆ stk_mon

void* stk_mon
extern

◆ vc_netdown_ops

struct vc_ops vc_netdown_ops
extern

◆ vc_netup_ops

struct vc_ops vc_netup_ops
extern