diff options
author | root <root@build-vm.(none)> | 2010-06-14 15:51:25 -0700 |
---|---|---|
committer | root <root@build-vm.(none)> | 2010-06-14 15:51:25 -0700 |
commit | c4414d9a8b31bedfb7471cd2365aaf5ea5cf55d5 (patch) | |
tree | 86ee5befd8195f56dcd91f9fd4e06368bf507a11 /include/local.h | |
download | conntrack-tools-c4414d9a8b31bedfb7471cd2365aaf5ea5cf55d5.tar.gz conntrack-tools-c4414d9a8b31bedfb7471cd2365aaf5ea5cf55d5.zip |
debian conntrack 0.9.14-2
Diffstat (limited to 'include/local.h')
-rw-r--r-- | include/local.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/local.h b/include/local.h new file mode 100644 index 0000000..f9121b1 --- /dev/null +++ b/include/local.h @@ -0,0 +1,37 @@ +#ifndef _LOCAL_SOCKET_H_ +#define _LOCAL_SOCKET_H_ + +#ifndef UNIX_PATH_MAX +#define UNIX_PATH_MAX 108 +#endif + +struct local_conf { + int backlog; + int reuseaddr; + char path[UNIX_PATH_MAX]; +}; + +struct local_server { + int fd; + char path[UNIX_PATH_MAX]; +}; + +/* callback return values */ +#define LOCAL_RET_ERROR -1 +#define LOCAL_RET_OK 0 +#define LOCAL_RET_STOLEN 1 + +/* local server */ +int local_server_create(struct local_server *server, struct local_conf *conf); +void local_server_destroy(struct local_server *server); +int do_local_server_step(struct local_server *server, void *data, + int (*process)(int fd, void *data)); + +/* local client */ +int local_client_create(struct local_conf *conf); +void local_client_destroy(int fd); +int do_local_client_step(int fd, void (*process)(char *buf)); +int do_local_request(int, struct local_conf *,void (*step)(char *buf)); +void local_step(char *buf); + +#endif |