File: ipcsocket.h

package info (click to toggle)
linux 5.10.28-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,142,388 kB
  • sloc: ansic: 19,494,753; asm: 263,677; sh: 73,927; makefile: 44,698; perl: 34,644; python: 32,383; cpp: 6,070; yacc: 4,755; lex: 2,742; awk: 1,214; ruby: 25; sed: 5
file content (35 lines) | stat: -rw-r--r-- 861 bytes parent folder | download | duplicates (10)
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
32
33
34
35

#ifndef _IPCSOCKET_H
#define _IPCSOCKET_H


#define MAX_SOCK_NAME_LEN	64

char sock_name[MAX_SOCK_NAME_LEN];

/* This structure is responsible for holding the IPC data
 * data: hold the buffer fd
 * len: just the length of 32-bit integer fd
 */
struct socketdata {
	int data;
	unsigned int len;
};

/* This API is used to open the IPC socket connection
 * name: implies a unique socket name in the system
 * connecttype: implies server(0) or client(1)
 */
int opensocket(int *sockfd, const char *name, int connecttype);

/* This is the API to send socket data over IPC socket */
int sendtosocket(int sockfd, struct socketdata *data);

/* This is the API to receive socket data over IPC socket */
int receivefromsocket(int sockfd, struct socketdata *data);

/* This is the API to close the socket connection */
int closesocket(int sockfd, char *name);


#endif