summaryrefslogtreecommitdiffstats
path: root/c/src/librdbg/src/servcon.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-08-02 15:00:07 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-08-02 15:00:07 +0000
commit261f99bdac9a995f8b2740b7ae52c8ad81001132 (patch)
tree2a5006b2c876e801a11527f6b20f47c312370b2f /c/src/librdbg/src/servcon.c
parent2007-08-02 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-261f99bdac9a995f8b2740b7ae52c8ad81001132.tar.bz2
2007-08-02 Joel Sherrill <joel.sherrill@OARcorp.com>
* configure.ac, wrapup/Makefile.am: Remove RDBG. * aclocal/check-rdbg.m4, aclocal/enable-rdbg.m4, librdbg/.cvsignore, librdbg/Makefile.am, librdbg/preinstall.am, librdbg/include/rdbg/rdbg.h, librdbg/include/rdbg/servrpc.h, librdbg/include/rdbg/i386/rdbg_f.h, librdbg/include/rdbg/i386/reg.h, librdbg/include/rdbg/m68k/rdbg_f.h, librdbg/include/rdbg/m68k/reg.h, librdbg/include/rdbg/powerpc/rdbg_f.h, librdbg/include/rdbg/powerpc/reg.h, librdbg/src/_servtgt.c, librdbg/src/awk.svc, librdbg/src/excep.c, librdbg/src/ptrace.c, librdbg/src/rdbg.c, librdbg/src/remdeb.x, librdbg/src/servbkpt.c, librdbg/src/servcon.c, librdbg/src/servrpc.c, librdbg/src/servtgt.c, librdbg/src/servtsp.c, librdbg/src/servutil.c, librdbg/src/i386/excep_f.c, librdbg/src/i386/rdbg_cpu_asm.S, librdbg/src/i386/rdbg_f.c, librdbg/src/i386/any/remdeb.h, librdbg/src/i386/any/remdeb_f.x, librdbg/src/i386/any/remdeb_svc.c, librdbg/src/i386/any/remdeb_xdr.c, librdbg/src/m68k/excep_f.c, librdbg/src/m68k/rdbg_cpu_asm.S, librdbg/src/m68k/rdbg_f.c, librdbg/src/m68k/any/remdeb.h, librdbg/src/m68k/any/remdeb_f.x, librdbg/src/m68k/any/remdeb_svc.c, librdbg/src/m68k/any/remdeb_xdr.c, librdbg/src/powerpc/excep_f.c, librdbg/src/powerpc/rdbg_cpu_asm.S, librdbg/src/powerpc/rdbg_f.c, librdbg/src/powerpc/new_exception_processing/remdeb.h, librdbg/src/powerpc/new_exception_processing/remdeb_f.x, librdbg/src/powerpc/new_exception_processing/remdeb_svc.c, librdbg/src/powerpc/new_exception_processing/remdeb_xdr.c: Removed.
Diffstat (limited to '')
-rw-r--r--c/src/librdbg/src/servcon.c155
1 files changed, 0 insertions, 155 deletions
diff --git a/c/src/librdbg/src/servcon.c b/c/src/librdbg/src/servcon.c
deleted file mode 100644
index 4775212edb..0000000000
--- a/c/src/librdbg/src/servcon.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- **************************************************************************
- *
- * Component: RDBG
- * Module: servcon.c
- *
- * Synopsis: Management of RPC client connections.
- *
- * $Id$
- *
- **************************************************************************
- */
-
-#include <errno.h>
-#include <rdbg/rdbg.h>
-#include <rdbg/servrpc.h>
-
- /*
- * ConnCreate - create a new connection entry for a client.
- *
- * This function finds an empty entry in the connection array
- * or makes space. It fills in the fields that are passed to it.
- * It does not do any validation on net addresses nor does it
- * start a validation cycle on other clients. This is done by
- * the caller.
- */
-
- int
-ConnCreate (struct svc_req *rqstp, open_in * in)
-{
- NET_OPAQUE sender;
- int idx;
- CONN_LIST *clst;
-
- setErrno (0);
-
- /*
- * Convert to valid Net address
- */
- if (!TspTranslateRpcAddr (rqstp, &sender)) {
- DPRINTF (("ConnCreate: TspTranslateRpcAddr failed\n"));
- return -1;
- }
- if (!TspValidateAddr ((NET_OPAQUE *) in->back_port, &sender)) {
- DPRINTF (("ConnCreate: TspValidateAddr failed\n"));
- return -1; /* errno now setup with error */
- }
-
- /*
- * look for an empty connection entry
- */
- for (idx = 0; idx < conn_list_cnt; idx++) {
- if (!conn_list[idx].in_use)
- break; /* an empty one found */
- }
-
- if (idx >= conn_list_cnt) { /* no empties, create space */
- CONN_LIST *tmp_conn_list = conn_list;
-
- conn_list_cnt += CONN_LIST_INC;
- if (conn_list) {
- conn_list = (CONN_LIST *) Realloc (conn_list, /* extend */
- conn_list_cnt * sizeof (CONN_LIST));
- } else {
- conn_list = (CONN_LIST *) Malloc (conn_list_cnt * sizeof (CONN_LIST));
- }
-
- if (!conn_list) { /* unable to get space */
- if ((conn_list_cnt -= CONN_LIST_INC)) {
- /*
- * was realloc, restore space
- */
- conn_list = tmp_conn_list;
- }
- return -1; /* errno set by failed alloc */
- }
- /*
- * clear newly created memory
- */
- memset (conn_list + idx, 0, CONN_LIST_INC * sizeof (CONN_LIST));
- } else { /* clear new entry */
- memset (conn_list + idx, 0, sizeof (CONN_LIST));
- }
- clst = conn_list + idx;
-
- clst->in_use = True; /* now in use */
- clst->sender = sender;
- memcpy (&clst->back_port, &in->back_port, sizeof (NET_OPAQUE));
- memcpy (&clst->route, &in->destination, sizeof (NET_OPAQUE));
- clst->debug_type = (UCHAR) in->debug_type;
- clst->flags = in->flags;
- strncpy (clst->user_name, in->user_name, NAMEMAX - 1);
- clst->user_name[NAMEMAX - 1] = 0;
-
- return idx;
-}
-
- /*
- * ConnDelete - remove connection entry when shutdown.
- *
- */
-
- void
-ConnDelete (int conn, struct svc_req *rqstp, close_control control)
-{
- CONN_LIST *clst = conn_list + conn;
- int idx;
- Boolean prim;
-
- if (!clst->in_use)
- return; /* not active */
-
- for (idx = 0; idx < pid_list_cnt; idx++) {
- PID_LIST *plst = pid_list + idx;
-
- if (!PIDMAP_TEST (conn, idx))
- continue;
-
- /*
- * found a controlled pid
- */
- prim = (plst->primary_conn == conn) ? True : False;
- TgtDetachCon (conn, idx, True);
-
- /*
- * if still running or alive, we use close control on it
- */
- if (!plst->pid)
- continue; /* entry gone */
-
- if (prim && control == CLOSE_KILL) {
- /*
- * kill off process
- */
- TgtKillAndDelete (plst, rqstp, True);
- } else if (!plst->owners) {
- /*
- * no owners left
- */
- if (control == CLOSE_DETACH) {
- TgtKillAndDelete (plst, rqstp, False);
- }
- if (control == CLOSE_DETACH || PROC_TERMINATED (plst)) {
- TgtDelete (plst, conn, (control == CLOSE_DETACH) ? BMSG_DETACH : 0);
- }
- }
- }
- if (clst->list) {
- Free (clst->list); /* free allocated memory */
- }
- DPRINTF (("ConnDelete: Connection closed for port %u\n",
- HL_W (*((UINT16 *) & clst->back_port.c[2]))));
-
- clst->in_use = False; /* free it back */
-}