| /*------------------------------------------------------------ | |
| (C) Copyright [2006-2008] Marvell International Ltd. | |
| All Rights Reserved | |
| ------------------------------------------------------------*/ | |
| #ifndef _BIP_SOCKET_H_ | |
| #define _BIP_SOCKET_H_ | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <errno.h> | |
| #include <sys/select.h> | |
| #include <sys/socket.h> | |
| #include <unistd.h> | |
| #include <sys/un.h> /*AF_UNIX */ | |
| // Linux | |
| #define SOCKET_DESC int | |
| #define SOCKET_ADDR_TYPE struct sockaddr_un | |
| #define INVALID_SOCKET (-1) | |
| #define SOCKET_ERROR (-1) | |
| #define IN | |
| #define OUT | |
| #ifdef __cplusplus | |
| extern "C" { | |
| #endif | |
| unsigned char MTIL_Accept(IN SOCKET_DESC mainSock, OUT SOCKET_DESC * sessionSock); | |
| unsigned char MTIL_Listen(IN SOCKET_DESC sock, IN int backlog); | |
| unsigned char MTIL_Connect(IN SOCKET_DESC sock, struct sockaddr *addrTo, IN int addrlen); | |
| unsigned char MTIL_SendSock(IN SOCKET_DESC sock, IN char *sndBuf, IN int sndSize, IN struct sockaddr *to); | |
| unsigned char MTIL_RecvSock(IN SOCKET_DESC sock, IN OUT char *rcvBuf, IN OUT int *bufSize, IN long waitSec, | |
| IN OUT struct sockaddr *from, int from_len); | |
| void MTIL_CloseSocket(IN OUT SOCKET_DESC * sock, char *keep_path); | |
| int MTIL_GetLastSocketError(void); | |
| #ifdef __cplusplus | |
| } | |
| #endif | |
| #endif/* _BIP_SOCKET_H_ */ | |