60#define MAX_PORT_TRIES 100
61#define FBS_CALLBACK_NULL (void (*)(void))NULL
62#define FBSERV_OBJ_NULL (struct fbserv_obj *)NULL
Header file for the BRL-CAD common definitions.
const char * fbs_ipc_child_addr_env(struct fbserv_obj *fbsp)
Return the "PKG_ADDR=<addr>" env string for the spawned child.
struct pkg_switch * fbs_pkg_switch(void)
int fbs_new_client(struct fbserv_obj *fbsp, struct pkg_conn *pcp, void *data)
int fbs_close(struct fbserv_obj *fbsp)
void fbs_setup_socket(int fd)
void fbs_existing_client_handler(void *clientData, int mask)
const char * fbs_generate_token(struct fbserv_obj *fbsp)
int fbs_open(struct fbserv_obj *fbsp, int port)
int fbs_open_ipc(struct fbserv_obj *fbsp)
Open an IPC-based framebuffer server (no TCP listen socket).
int fbsc_pending_drop
!0 = drop this client after pkg_process() returns
struct fbserv_obj * fbsc_fbsp
points to its fbserv object
struct pkg_conn * fbsc_pkg
int fbsc_auth_ok
!0 = client has sent a valid MSG_FBAUTH
void * fbsc_chan
platform/toolkit specific channel
int fbsc_fd
socket to send data down
int fbsc_is_ipc
!0 = client is connected via IPC (not TCP)
void * fbsc_handler
platform/toolkit specific handler
struct pkg_conn * fbsl_ipc_child
IPC child-end channel (NULL when using TCP)
struct fbserv_obj * fbsl_fbsp
points to its fbserv object
int fbsl_port
port number to listen on
struct pkg_listener * fbsl_listener
TCP listener (NULL when using IPC or Tcl channel)
void * fbsl_chan
platform/toolkit specific channel
int fbsl_fd
socket fd to listen for connections (copy of listener fd)
int fbsl_listen
!0 means listen for connections
char fbs_auth_token[65]
session token (64 hex chars + NUL); empty = no auth required
void(* fbs_open_server_handler)(struct fbserv_obj *)
platform/toolkit method to open listener handler
struct fbserv_client fbs_clients[MAX_CLIENTS]
connected clients
void(* fbs_callback)(void *)
callback function
int(* fbs_listen_on_port)(struct fbserv_obj *, int)
return 1 on success, 0 on failure
void(* fbs_close_server_handler)(struct fbserv_obj *)
platform/toolkit method to close handler listener
void(* fbs_close_ipc_client_handler)(struct fbserv_obj *, int)
Optional IPC-specific client close handler (mirrors fbs_close_client_handler).
struct fbserv_listener fbs_listener
data for listening
int fbs_mode
0-off, 1-underlay, 2-interlay, 3-overlay
void(* fbs_close_client_handler)(struct fbserv_obj *, int)
platform/toolkit method to close handler for client at index client_id
int fbs_require_auth
!0 = reject clients that don't send MSG_FBAUTH
struct fb * fbs_fbp
framebuffer pointer
void * fbs_tls_ctx
opaque SSL_CTX* for TLS; NULL = no TLS
void * fbs_interp
interpreter
void(* fbs_open_ipc_client_handler)(struct fbserv_obj *, int, void *)
Optional IPC-specific client open handler.
void(* fbs_open_client_handler)(struct fbserv_obj *, int, void *)
platform/toolkit specific client handler setup (called by fbs_new_client)
int(* fbs_is_listening)(struct fbserv_obj *)
return 1 if listening, else 0