Obsolete
/
libipc-old
Archived
3
0
Fork 0
This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues/pull-requests.
libipc-old/remote/tcpdserver.h

37 lines
848 B
C
Raw Normal View History

#ifndef __TCPDSERVER_H__
#define __TCPDSERVER_H__
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
typedef struct {
struct sockaddr_in c_sock;
int sfd;
2016-09-18 00:17:47 +02:00
char * fifoOut;
} p_data;
int initConnection ();
void endConnection (int sock, int csock);
2016-09-18 01:03:37 +02:00
void printClientAddr (struct sockaddr_in *csin);
2016-09-18 01:03:37 +02:00
void write_message(int sock, const char *buffer);
int read_message(int sock, char *buffer);
2016-09-18 01:03:37 +02:00
//2 threads for listen and send data
void * listen_thread(void * pdata);
void * send_thread(void * pdata);
//parse the first message from client in service and version
2016-09-18 00:17:47 +02:00
void parseServiceVersion(char * buf, char ** service, int *version);
2016-09-18 01:03:37 +02:00
//create 2 pathnames such as : pid-index-version-in/out
void inOutPathCreate(char ** pathname, int version);
2016-09-18 01:03:37 +02:00
//create a fifo file
int fifo_create (char * path);
#endif