ipsnooper.h File Reference

Related to the IP Snooper application. More...

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#include <unistd.h>
#include <isc/eventlib.h>
#include <signal.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <jnx/jnx_types.h>
#include <jnx/aux_types.h>
#include <jnx/mpsdk.h>
#include <jnx/msp_hash.h>
#include <jnx/atomic.h>
#include <jnx/msp_locks.h>
#include <jnx/trace.h>
#include <sys/jnx/jbuf.h>

Data Structures

struct  srv_msg_s
struct  pkt_msg_s
struct  pkt_thrd_s
struct  ssn_thrd_s
struct  ssn_s
struct  server_s


#define IPSNOOPER_PORT   48008
#define MAX_LINE_BUF_SIZE   128
#define IPV4_ADDR_STR_LEN   16
#define IPV4_ADDR_LEN   4
#define PIPE_READ   0
#define PIPE_WRITE   1
#define INSIST_ERR(c)


typedef srv_msg_s srv_msg_t
typedef pkt_msg_s pkt_msg_t
typedef pkt_thrd_s pkt_thrd_t
typedef ssn_thrd_s ssn_thrd_t
typedef ssn_s ssn_t
typedef server_s server_t


enum  srv_msg_op_e { MSG_OP_ADD = 0, MSG_OP_DEL }


int packet_loop_init (void)
void packet_thread_exit (pkt_thrd_t *thrd)
void session_thread_exit (ssn_thrd_t *thrd)
int server_init (evContext ctx)
void server_close (void)

Detailed Description

Related to the IP Snooper application.

Define Documentation

#define INSIST_ERR (  ) 


if (!(c)) \
    logging(LOG_EMERG, "%s:%d: insist '%s' ERROR: %m", \
        __FILE__, __LINE__, #c); else (void)NULL
Define an INSIST/assert with logging.


The maximum concurrent incomming connections to IP Snooper server.

#define IPSNOOPER_PORT   48008

The TCP port for IP Snooper server.

#define IPV4_ADDR_LEN   4

length of IPv4 address in byte

#define IPV4_ADDR_STR_LEN   16

max length of IPv4 address string

#define MAX_LINE_BUF_SIZE   128

The maximum buffer size for each line of client request.


retry times to send packet

#define PIPE_READ   0

pipe read FD index

#define PIPE_WRITE   1

pipe write FD index

Typedef Documentation

typedef struct pkt_msg_s pkt_msg_t

Packet pipe message.

typedef struct pkt_thrd_s pkt_thrd_t

Packet thread data structure.

typedef struct server_s server_t

IP Snooper server data structure.

typedef struct srv_msg_s srv_msg_t

Server pipe message.

typedef struct ssn_s ssn_t

Session data structure.

typedef struct ssn_thrd_s ssn_thrd_t

Session thread data structure, one for each thread running a control CPU. Each thread could handle multiple client sessions whoes flows are bound to the same control CPU.

Enumeration Type Documentation

enum srv_msg_op_e

Operation for server pipe message.

MSG_OP_ADD  add a new session
MSG_OP_DEL  delete en existing session

Function Documentation

int packet_loop_init ( void   ) 

Initialize packet loops

MSP_OK on success, MSP error code on failure

void packet_thread_exit ( pkt_thrd_t thrd  ) 

Packet thread exit.

[in] thrd Pointer to the packet thread data

void server_close ( void   ) 

Close the server only.

int server_init ( evContext  ctx  ) 

Initialize the server

[in] ctx Event context
0 on success, -1 on failure

void session_thread_exit ( ssn_thrd_t thrd  ) 

Session thread exit.

[in] thrd Pointer to the session thread data

2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:27:00 2010 for SDK Your Net Corporation IP Snooper 1.0 by Doxygen 1.5.1