Stackdb
Stackdb is a stackable, multi-target and -level source debugger and memory forensics library.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
proxyreq.c File Reference
#include <stdsoap2.h>
#include <pthread.h>
#include <sys/prctl.h>
#include "log.h"
#include "monitor.h"
#include "proxyreq.h"
Include dependency graph for proxyreq.c:

Go to the source code of this file.

Macros

#define PROXYREQ_REQUEST   1
 
#define PROXYREQ_RESPONSE   2
 
#define THREAD_SPLITREQ(soap, tm)
 
#define FORK_SPLITREQ(soap, tm)
 

Functions

int proxyreq_handle_request (struct soap *soap, char *svc_name)
 
struct proxyreqproxyreq_create (struct soap *soap)
 
struct proxyreqproxyreq_create_proxied (int objid, char *buf, int buflen)
 
int proxyreq_switchto_proxied (struct proxyreq *pr)
 
int proxyreq_attach_objid (struct proxyreq *pr, int objid)
 
int proxyreq_attach_new_objid (struct proxyreq *pr, int objid, struct monitor *monitor)
 
int proxyreq_send_request (struct proxyreq *pr)
 
int proxyreq_send_response (struct proxyreq *pr)
 
int proxyreq_recv_request (struct monitor *monitor, struct monitor_msg *msg)
 
int proxyreq_recv_response (struct monitor *monitor, struct monitor_msg *msg)
 
void proxyreq_detach_soap (struct proxyreq *pr)
 
void proxyreq_free_buffer (struct proxyreq *pr)
 
void proxyreq_free (struct proxyreq *pr)
 

Macro Definition Documentation

#define FORK_SPLITREQ (   soap,
  tm 
)
Value:
{ \
struct splitreq *_sr; \
struct splitreq_data srd; \
\
_sr = (struct splitreq *)(soap)->user; \
if (!_sr) { \
verror("no splitreq state!\n"); \
return SOAP_ERR; \
} \
if ((soap)->frecv == splitreq_frecv_save) { \
splitreq_split((soap),1); \
_srd.buf = _sr->buf; \
_srd.buflen = _sr->buflen; \
if (process_monitor_send_request(tm,&srd)) { \
verror("could not send request to pid %d",tm->p.pid); \
return SOAP_ERR; \
} \
else \
return SOAP_STOP; \
} \
else if ((soap)->frecv == splitreq_frecv_read) { \
splitreq_fini(soap); \
/* Caller normally executes RPC here... */ \
} \
else { \
verror("unexpected soap->frecv value; user error?!\n"); \
return SOAP_ERR; \
} \
}
#define verror(format,...)
Definition: log.h:30

Definition at line 757 of file proxyreq.c.

#define PROXYREQ_REQUEST   1

Definition at line 444 of file proxyreq.c.

#define PROXYREQ_RESPONSE   2

Definition at line 445 of file proxyreq.c.

#define THREAD_SPLITREQ (   soap,
  tm 
)
Value:
{ \
struct splitreq *_sr; \
_sr = (struct splitreq *)(soap)->user; \
if (!_sr) { \
verror("no splitreq state!\n"); \
return SOAP_ERR; \
} \
if ((soap)->frecv == splitreq_frecv_save) { \
splitreq_split((soap),0); \
/* XXX: normally have to queue for thread or send to pid */ \
return SOAP_STOP; \
} \
else if ((soap)->frecv == splitreq_frecv_read) { \
splitreq_fini(soap); \
/* Caller normally executes RPC here... */ \
} \
else { \
verror("unexpected soap->frecv value; user error?!\n"); \
return SOAP_ERR; \
} \
}
#define verror(format,...)
Definition: log.h:30

Definition at line 736 of file proxyreq.c.

Function Documentation

int proxyreq_attach_new_objid ( struct proxyreq pr,
int  objid,
struct monitor monitor 
)

Definition at line 421 of file proxyreq.c.

int proxyreq_attach_objid ( struct proxyreq pr,
int  objid 
)

Definition at line 400 of file proxyreq.c.

struct proxyreq* proxyreq_create ( struct soap *  soap)

proxyreq API implementation.

Definition at line 298 of file proxyreq.c.

struct proxyreq* proxyreq_create_proxied ( int  objid,
char *  buf,
int  buflen 
)

Definition at line 332 of file proxyreq.c.

void proxyreq_detach_soap ( struct proxyreq pr)

Definition at line 692 of file proxyreq.c.

void proxyreq_free ( struct proxyreq pr)

Definition at line 717 of file proxyreq.c.

void proxyreq_free_buffer ( struct proxyreq pr)

Definition at line 707 of file proxyreq.c.

int proxyreq_handle_request ( struct soap *  soap,
char *  svc_name 
)

The main function this library exposes to servers.

Definition at line 30 of file proxyreq.c.

int proxyreq_recv_request ( struct monitor monitor,
struct monitor_msg msg 
)

The following basically interact with monitors via messages or the msg_obj hashtable. They also interact with gsoap to effect the proxying.

Definition at line 552 of file proxyreq.c.

int proxyreq_recv_response ( struct monitor monitor,
struct monitor_msg msg 
)

Definition at line 621 of file proxyreq.c.

int proxyreq_send_request ( struct proxyreq pr)

Definition at line 447 of file proxyreq.c.

int proxyreq_send_response ( struct proxyreq pr)

Definition at line 507 of file proxyreq.c.

int proxyreq_switchto_proxied ( struct proxyreq pr)

Definition at line 387 of file proxyreq.c.