2020-04-12 05:34:56 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <sys/un.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
|
2020-06-19 03:52:25 -07:00
|
|
|
socklen_t setup_sockaddr(sockaddr_un *sun, const char *name);
|
|
|
|
int create_app_socket(sockaddr_un *sun);
|
2020-04-12 05:34:56 -07:00
|
|
|
int socket_accept(int sockfd, int timeout);
|
|
|
|
void get_client_cred(int fd, struct ucred *cred);
|
|
|
|
int recv_fd(int sockfd);
|
|
|
|
void send_fd(int sockfd, int fd);
|
|
|
|
int read_int(int fd);
|
|
|
|
int read_int_be(int fd);
|
|
|
|
void write_int(int fd, int val);
|
|
|
|
void write_int_be(int fd, int val);
|
|
|
|
char *read_string(int fd);
|
|
|
|
char *read_string_be(int fd);
|
|
|
|
void write_string(int fd, const char *val);
|
|
|
|
void write_string_be(int fd, const char *val);
|
|
|
|
void write_key_value(int fd, const char *key, const char *val);
|
|
|
|
void write_key_token(int fd, const char *key, int tok);
|