BRL-CAD
fbserv_obj.c File Reference
#include "common.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <tcl.h>
#include "raytrace.h"
#include "dm.h"
#include "fbmsg.h"
#include "fbserv_obj.h"
#include "fb_private.h"
Include dependency graph for fbserv_obj.c:

Go to the source code of this file.

Functions

HIDDEN void comm_error (const char *str)
 
HIDDEN void drop_client (struct fbserv_obj *fbsp, int sub)
 
HIDDEN void existing_client_handler (ClientData clientData, int mask)
 
HIDDEN void setup_socket (int fd)
 
HIDDEN void new_client (struct fbserv_obj *fbsp, struct pkg_conn *pcp, Tcl_Channel chan)
 
HIDDEN void fbs_rfbunknown (struct pkg_conn *pcp, char *buf)
 
HIDDEN void fbs_rfbopen (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbclose (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbfree (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbclear (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbread (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbwrite (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbreadrect (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbwriterect (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbbwreadrect (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbbwwriterect (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbcursor (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbgetcursor (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbsetcursor (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbscursor (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbwindow (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbzoom (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbview (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbgetview (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbrmap (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbwmap (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbflush (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbpoll (struct pkg_conn *pcp, char *buf)
 
void fbs_rfbhelp (struct pkg_conn *pcp, char *buf)
 
HIDDEN void new_client_handler (ClientData clientData, Tcl_Channel chan, char *host, int port)
 
int fbs_open (struct fbserv_obj *fbsp, int port)
 
int fbs_close (struct fbserv_obj *fbsp)
 

Detailed Description

A framebuffer server object contains the attributes and methods for implementing an fbserv. This code was developed in large part by modifying the stand-alone version of fbserv.

Definition in file fbserv_obj.c.

Function Documentation

HIDDEN void comm_error ( const char *  str)

Definition at line 61 of file fbserv_obj.c.

References bu_log().

Referenced by fbs_open(), fbs_rfbfree(), fbs_rfbopen(), and new_client_handler().

Here is the call graph for this function:

HIDDEN void drop_client ( struct fbserv_obj *  fbsp,
int  sub 
)

Definition at line 68 of file fbserv_obj.c.

References PKC_NULL, and pkg_close().

Referenced by existing_client_handler(), and fbs_close().

Here is the call graph for this function:

HIDDEN void existing_client_handler ( ClientData  clientData,
int  mask 
)

Definition at line 94 of file fbserv_obj.c.

References bu_log(), drop_client(), pkg_process(), and pkg_suckin().

Referenced by new_client().

Here is the call graph for this function:

HIDDEN void setup_socket ( int  fd)

Definition at line 134 of file fbserv_obj.c.

References bu_log().

Referenced by new_client().

Here is the call graph for this function:

HIDDEN void new_client ( struct fbserv_obj *  fbsp,
struct pkg_conn pcp,
Tcl_Channel  chan 
)

Definition at line 204 of file fbserv_obj.c.

References bu_log(), existing_client_handler(), PKC_ERROR, pkg_conn::pkc_fd, pkg_close(), and setup_socket().

Referenced by new_client_handler().

Here is the call graph for this function:

HIDDEN void fbs_rfbunknown ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 277 of file fbserv_obj.c.

References bu_log(), and pkg_conn::pkc_type.

Referenced by new_client_handler().

Here is the call graph for this function:

HIDDEN void fbs_rfbopen ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 289 of file fbserv_obj.c.

References comm_error(), fb_internal::if_height, fb_internal::if_max_height, fb_internal::if_max_width, fb_internal::if_width, NET_LONG_LEN, pkg_plong(), and pkg_send().

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbclose ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 312 of file fbserv_obj.c.

References fb_flush(), NET_LONG_LEN, pkg_plong(), and pkg_send().

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbfree ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 336 of file fbserv_obj.c.

References comm_error(), NET_LONG_LEN, and pkg_send().

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbclear ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 351 of file fbserv_obj.c.

References BLU, bu_log(), fb_clear(), GRN, NET_LONG_LEN, pkg_plong(), pkg_send(), and RED.

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbread ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 373 of file fbserv_obj.c.

References bu_log(), fb_log(), fb_read(), NET_LONG_LEN, pkg_glong(), and pkg_send().

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbwrite ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 413 of file fbserv_obj.c.

References bu_log(), fb_write(), NET_LONG_LEN, pkg_conn::pkc_type, pkg_glong(), pkg_plong(), and pkg_send().

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbreadrect ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 440 of file fbserv_obj.c.

References bu_log(), fb_log(), fb_readrect(), NET_LONG_LEN, pkg_glong(), pkg_send(), and OSL::Strings::width.

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbwriterect ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 483 of file fbserv_obj.c.

References bu_log(), fb_writerect(), NET_LONG_LEN, pkg_conn::pkc_type, pkg_glong(), pkg_plong(), pkg_send(), and OSL::Strings::width.

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbbwreadrect ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 514 of file fbserv_obj.c.

References bu_log(), fb_bwreadrect(), fb_log(), NET_LONG_LEN, pkg_glong(), pkg_send(), and OSL::Strings::width.

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbbwwriterect ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 557 of file fbserv_obj.c.

References bu_log(), fb_writerect(), NET_LONG_LEN, pkg_conn::pkc_type, pkg_glong(), pkg_plong(), pkg_send(), and OSL::Strings::width.

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbcursor ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 588 of file fbserv_obj.c.

References bu_log(), fb_cursor(), NET_LONG_LEN, pkg_glong(), pkg_plong(), and pkg_send().

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbgetcursor ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 609 of file fbserv_obj.c.

References fb_getcursor(), NET_LONG_LEN, pkg_plong(), and pkg_send().

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbsetcursor ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 629 of file fbserv_obj.c.

References bu_log(), fb_setcursor(), NET_LONG_LEN, pkg_conn::pkc_type, pkg_glong(), pkg_plong(), and pkg_send().

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbscursor ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 659 of file fbserv_obj.c.

References bu_log(), fb_scursor(), NET_LONG_LEN, pkg_glong(), pkg_plong(), and pkg_send().

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbwindow ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 681 of file fbserv_obj.c.

References bu_log(), fb_window(), NET_LONG_LEN, pkg_glong(), pkg_plong(), and pkg_send().

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbzoom ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 703 of file fbserv_obj.c.

References bu_log(), fb_zoom(), NET_LONG_LEN, pkg_glong(), pkg_plong(), and pkg_send().

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbview ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 723 of file fbserv_obj.c.

References bu_log(), fb_view(), NET_LONG_LEN, pkg_glong(), pkg_plong(), and pkg_send().

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbgetview ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 747 of file fbserv_obj.c.

References fb_getview(), NET_LONG_LEN, pkg_plong(), and pkg_send().

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbrmap ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 768 of file fbserv_obj.c.

References ColorMap::cm_blue, ColorMap::cm_green, ColorMap::cm_red, fb_rmap(), MSG_DATA, NET_LONG_LEN, pkg_plong(), pkg_pshort(), and pkg_send().

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbwmap ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 797 of file fbserv_obj.c.

References bu_log(), ColorMap::cm_blue, ColorMap::cm_green, ColorMap::cm_red, COLORMAP_NULL, fb_wmap(), NET_LONG_LEN, pkg_conn::pkc_len, pkg_gshort(), pkg_plong(), and pkg_send().

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbflush ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 826 of file fbserv_obj.c.

References fb_flush(), NET_LONG_LEN, pkg_conn::pkc_type, pkg_plong(), and pkg_send().

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbpoll ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 845 of file fbserv_obj.c.

References fb_poll(), and PKC_ERROR.

Referenced by new_client_handler().

Here is the call graph for this function:

void fbs_rfbhelp ( struct pkg_conn pcp,
char *  buf 
)

Definition at line 863 of file fbserv_obj.c.

References bu_log(), fb_help(), NET_LONG_LEN, pkg_glong(), pkg_plong(), and pkg_send().

Referenced by new_client_handler().

Here is the call graph for this function:

HIDDEN void new_client_handler ( ClientData  clientData,
Tcl_Channel  chan,
char *  host,
int  port 
)
int fbs_open ( struct fbserv_obj *  fbsp,
int  port 
)

Definition at line 983 of file fbserv_obj.c.

References bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_printf(), comm_error(), new_client_handler(), and pkg_permserver().

Referenced by fbo_listen_tcl(), and to_listen().

Here is the call graph for this function:

int fbs_close ( struct fbserv_obj *  fbsp)

Definition at line 1073 of file fbserv_obj.c.

References drop_client(), and new_client_handler().

Referenced by fbo_listen_tcl(), and to_listen().

Here is the call graph for this function: