diff options
| author | Anton <anton@picapica> | 2016-04-07 21:17:57 +0400 |
|---|---|---|
| committer | Anton <anton@picapica> | 2016-04-07 21:17:57 +0400 |
| commit | fff351c20da3294f9f8d13d94660fea099093738 (patch) | |
| tree | f6230721c0d836c9d3fb9c63dc9b1e94344f9a55 /PICA_node.h | |
| parent | d56c7301b718754c7ec6b2baad603ff001d5a46a (diff) | |
| download | pica-pica-fff351c20da3294f9f8d13d94660fea099093738.tar.gz pica-pica-fff351c20da3294f9f8d13d94660fea099093738.zip | |
fixed code style using "astyle --style=allman --lineend=linux --indent=tab --pad-oper *.c *.h"
Diffstat (limited to 'PICA_node.h')
| -rw-r--r--[-rwxr-xr-x] | PICA_node.h | 136 |
1 files changed, 68 insertions, 68 deletions
diff --git a/PICA_node.h b/PICA_node.h index e635df2..4d95417 100755..100644 --- a/PICA_node.h +++ b/PICA_node.h @@ -68,8 +68,8 @@ #define PICA_NETWORKNAME "TESTNET" // TEMP //CONF #define NEWCONN_BUFSIZE 58 //FIXME this is the size of CONNID packet, this packet is followed by TLS session negotiation data. - //TLS data must not be interpreted as some PICA packet by PICA_processdatastream(), - //so buffer size is limited by the size of CONNID. +//TLS data must not be interpreted as some PICA packet by PICA_processdatastream(), +//so buffer size is limited by the size of CONNID. #define DEFAULT_BUF_SIZE 4096 @@ -78,92 +78,92 @@ struct nodelink; struct client { -unsigned char id[PICA_ID_SIZE]; -struct client *up; -struct client *left; -struct client *right; -SOCKET sck_comm; -struct sockaddr_in addr; -SSL *ssl_comm; -unsigned char *r_buf; -unsigned char *w_buf; -unsigned int buflen_r; -unsigned int buflen_w; -unsigned int r_pos; -unsigned int w_pos; - -unsigned int btw_ssl;//кол-во отправляемых байтов, передаваемое функции SSL_write + unsigned char id[PICA_ID_SIZE]; + struct client *up; + struct client *left; + struct client *right; + SOCKET sck_comm; + struct sockaddr_in addr; + SSL *ssl_comm; + unsigned char *r_buf; + unsigned char *w_buf; + unsigned int buflen_r; + unsigned int buflen_w; + unsigned int r_pos; + unsigned int w_pos; + + unsigned int btw_ssl;//кол-во отправляемых байтов, передаваемое функции SSL_write //Если требуется повторный вызов SSL_write,то нужно передавать те же значения аргументов,а w_pos может быть увеличен // -int state; -struct client* next;//структура client может быть одновременно в составе дерева и линейного списка -struct client* prev; + int state; + struct client* next;//структура client может быть одновременно в составе дерева и линейного списка + struct client* prev; -time_t tmst; -int disconnect_ticking;//on sending message TO client this var is set to 1, on receiving some message FROM client this var is reset to 0 + time_t tmst; + int disconnect_ticking;//on sending message TO client this var is set to 1, on receiving some message FROM client this var is reset to 0 }; struct cclink //структура, описывающая соединение двух клиентов между собой через сервер { //unsigned int cclink_id; -unsigned int state; - -time_t tmst; -struct client *p1;//caller -struct client *p2;//callee - -unsigned char *caller_id; -unsigned char *callee_id; - -struct nodelink *caller_node; -struct nodelink *callee_node; - -SOCKET sck_p1; -SOCKET sck_p2; -int jam_p1p2; -int jam_p2p1; -char* buf_p1p2; -char* buf_p2p1; -unsigned int buflen_p1p2; -unsigned int buflen_p2p1; -unsigned int bufpos_p1p2; -unsigned int bufpos_p2p1; -struct cclink *next; -struct cclink *prev; - -int disconnect_ticking; + unsigned int state; + + time_t tmst; + struct client *p1;//caller + struct client *p2;//callee + + unsigned char *caller_id; + unsigned char *callee_id; + + struct nodelink *caller_node; + struct nodelink *callee_node; + + SOCKET sck_p1; + SOCKET sck_p2; + int jam_p1p2; + int jam_p2p1; + char* buf_p1p2; + char* buf_p2p1; + unsigned int buflen_p1p2; + unsigned int buflen_p2p1; + unsigned int bufpos_p1p2; + unsigned int bufpos_p2p1; + struct cclink *next; + struct cclink *prev; + + int disconnect_ticking; }; struct newconn //структура, описывающая новое подключение (клиента) { -SOCKET sck; -struct sockaddr_in addr; -time_t tmst; -int pos; -unsigned char buf[NEWCONN_BUFSIZE]; + SOCKET sck; + struct sockaddr_in addr; + time_t tmst; + int pos; + unsigned char buf[NEWCONN_BUFSIZE]; }; struct nodelink { -struct sockaddr_in addr; -SOCKET sck; -SSL *ssl; + struct sockaddr_in addr; + SOCKET sck; + SSL *ssl; -unsigned int addr_type;//тип адреса узла - PICA_PROTO_NEWNODE_IPV4,PICA_PROTE_NEWNODE_IPV6,... -void *node_addr;//указатель на структуру адреса {PICA_nodeaddr_ipv4, PICA_nodeaddr_ipv6,PICA_nodeaddr_dns,..} + unsigned int addr_type;//тип адреса узла - PICA_PROTO_NEWNODE_IPV4,PICA_PROTE_NEWNODE_IPV6,... + void *node_addr;//указатель на структуру адреса {PICA_nodeaddr_ipv4, PICA_nodeaddr_ipv6,PICA_nodeaddr_dns,..} -unsigned char *r_buf; -unsigned char *w_buf; -unsigned int buflen_r; -unsigned int buflen_w; -unsigned int r_pos; -unsigned int w_pos; + unsigned char *r_buf; + unsigned char *w_buf; + unsigned int buflen_r; + unsigned int buflen_w; + unsigned int r_pos; + unsigned int w_pos; -struct nodelink *next; -struct nodelink *prev; + struct nodelink *next; + struct nodelink *prev; -time_t tmst; -int disconnect_ticking; + time_t tmst; + int disconnect_ticking; }; |
