-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcortex_socket.h
More file actions
31 lines (22 loc) · 876 Bytes
/
Copy pathcortex_socket.h
File metadata and controls
31 lines (22 loc) · 876 Bytes
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 CORTEX_SOCKET_H
#define CORTEX_SOCKET_H
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <ctype.h>
#include <netdb.h>
#include <unistd.h>
typedef int SOCKET;
#define INVALID_SOCKET -1
#define SOCKET_ERROR -1
SOCKET Socket_CreateForBroadcasting(unsigned long IP_Address,
unsigned short uPort);
int ConvertToIPAddress(const char *szNameOrAddress, struct in_addr *Address);
int Broadcast(SOCKET sockfd, unsigned short uPort, const char *Buffer, int nBytes);
SOCKET Socket_CreateLargeMultiCast(in_addr MyAddress, unsigned short MyPort,
in_addr MultiCastAddress);
int Cortex_GetAllOfMyAddresses(unsigned long Addresses[], int nMax);
int GetHostByAddr(unsigned char Address[4], char *szName);
#endif