-
Notifications
You must be signed in to change notification settings - Fork 42
/
pel.h
31 lines (24 loc) · 898 Bytes
/
pel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef _PEL_H
#define _PEL_H
#define BUFSIZE 128 /* maximum message length */
#define PEL_SUCCESS 1
#define PEL_FAILURE 0
#define PEL_SYSTEM_ERROR -1
#define PEL_CONN_CLOSED -2
#define PEL_WRONG_CHALLENGE -3
#define PEL_BAD_MSG_LENGTH -4
#define PEL_CORRUPTED_DATA -5
#define PEL_UNDEFINED_ERROR -6
extern int pel_errno;
#ifdef WIN32
int pel_client_init( SOCKET server, char *key );
int pel_server_init( SOCKET client, char *key );
int pel_send_msg( SOCKET sockfd, unsigned char *msg, int length );
int pel_recv_msg( SOCKET sockfd, unsigned char *msg, int *length );
#else
int pel_client_init( int server, char *key );
int pel_server_init( int client, char *key );
int pel_send_msg( int sockfd, unsigned char *msg, int length );
int pel_recv_msg( int sockfd, unsigned char *msg, int *length );
#endif
#endif /* pel.h */