FACT++  1.0
static void recv_rout ( int  conn_id,
DIC_DNS_PACKET packet,
int  size,
int  status 
)
static

Definition at line 105 of file dns.c.

References Debug, dim_print_date_time(), handle_client_request(), handle_registration(), Net_conns, release_conn(), DIC_DNS_PACKET::size, SRC_DIC, SRC_DIS, DIC_DNS_PACKET::src_type, STA_CONN, STA_DATA, and STA_DISC.

Referenced by main().

106 {
107  int handle_registration();
108  int handle_client_request();
109 
110  if(size){}
111  switch(status)
112  {
113  case STA_DISC: /* connection broken */
114 
115  if(Debug)
116  {
118  printf(" Disconnect received - conn: %d to %s@%s\n", conn_id,
119  Net_conns[conn_id].task,Net_conns[conn_id].node );
120  }
121 
122  release_conn( conn_id );
123  break;
124  case STA_CONN: /* connection received */
125  if(Debug)
126  {
128  printf(" Connection request received - conn: %d\n", conn_id);
129  }
130  /* handle_conn( conn_id ); */
131  break;
132  case STA_DATA: /* normal packet */
133  switch( vtohl(packet->src_type) )
134  {
135  case SRC_DIS :
136  handle_registration(conn_id, (DIS_DNS_PACKET *)packet, 1);
137  break;
138  case SRC_DIC :
139  handle_client_request(conn_id,(DIC_DNS_PACKET *)packet);
140  break;
141  default:
143  printf(" conn: %d to %s@%s, Bad packet\n", conn_id,
144  Net_conns[conn_id].task,Net_conns[conn_id].node );
145  printf("packet->size = %d\n", vtohl(packet->size));
146  printf("packet->src_type = %d\n", vtohl(packet->src_type));
147  printf( "closing the connection.\n" );
148  fflush(stdout);
149  release_conn( conn_id );
150 /*
151  panic( "recv_rout(): Bad switch(1)" );
152 */
153  }
154  break;
155  default:
157  printf( " - DIM panic: recv_rout(): Bad switch, exiting...\n");
158  abort();
159  }
160 }
#define STA_DATA
Definition: dim.h:198
Definition: dns.c:26
static void release_conn(int conn_id)
Definition: dns.c:1077
int handle_registration(int conn_id, DIS_DNS_PACKET *packet, int tmout_flag)
Definition: dns.c:176
#define STA_DISC
Definition: dim.h:197
DllExp DIM_NOSHARE NET_CONNECTION * Net_conns
Definition: conn_handler.c:32
SRC_TYPES src_type
Definition: dim.h:301
int size
Definition: dim.h:300
int handle_client_request(int conn_id, DIC_DNS_PACKET *packet)
Definition: dns.c:660
int size
Definition: db_dim_server.c:17
void dim_print_date_time()
Definition: utilities.c:134
static int Debug
Definition: dns.c:78
#define STA_CONN
Definition: dim.h:199

+ Here is the call graph for this function:

+ Here is the caller graph for this function: