ipprobe-mt.h File Reference

The header file for the IP Probe MT. More...

Go to the source code of this file.

Data Structures

struct  probe_params_s
struct  probe_pkt_data_t
struct  probe_pkt_t
struct  probe_s
struct  pkt_stats_t
struct  probe_result_t
struct  probe_rx_buf_s
struct  probe_dst_t
struct  rspd_mgmt_pkt_t
struct  probe_mngr_t
struct  rspd_mngr_t
struct  rspd_s

Defines

#define IP_HEADER_LEN   20
#define PROBE_NAME_LEN   64
#define PROBE_MNGR_PORT_DEFAULT   6068
#define RSPD_MNGR_PORT_DEFAULT   6069
#define CONN_RETRY_DEFAULT   32
#define PROBE_MGMT_MSG_REG   1
#define PROBE_MGMT_MSG_ADD_DST   2
#define RSPD_MGMT_MSG_REQ   1
#define RSPD_MGMT_MSG_ACK   2
#define PROBE_PKT_REQ   1
#define PROBE_PKT_REPLY   2
#define PROBE_PKT_REQ_LAST   3
#define PROBE_PKT_SIZE_MIN   64
#define PROBE_PKT_SIZE_MAX   1024
#define PROBE_PKT_COUNT_MAX   200
#define PROBE_PKT_TTL_DEFAULT   128
#define PROBE_TRACE(_msg_type, _fmt,...)   junos_trace((_msg_type), _fmt, ##__VA_ARGS__)
#define PROBE_LOG(_level, _fmt,...)   ERRMSG(IPPROBE-MT, (_level), _fmt, ##__VA_ARGS__)

Typedefs

typedef probe_params_s probe_params_t
typedef probe_s probe_t
typedef probe_rx_buf_s probe_rx_buf_t
typedef rspd_s rspd_t

Enumerations

enum  probe_dst_state_t { PROBE_DST_STATE_INIT, PROBE_DST_STATE_RUN, PROBE_DST_STATE_DONE }

Functions

int probe_mngr_init (evContext lev_ctx)
 Initialize the probe manager.
int probe_mngr_open (uint16_t port)
 Open the probe manager.
int probe_mngr_probe_start (char *name, in_addr_t dst_addr)
 Start the probe.
int probe_mngr_probe_stop (char *name)
 Stop the probe.
int probe_mngr_probe_clear (char *name)
 Clear the probe.
patroot * probe_mngr_probe_result_get (char *name)
 Get the result of the probe.
void probe_mngr_close (void)
 Close the probe manager.
int rspd_mngr_init (evContext lev_ctx)
int rspd_mngr_open (uint16_t port)
void rspd_mngr_close (void)
int config_read (int check)
probe_params_tprobe_params_get (char *name)
void * probe_thrd_entry (probe_t *probe)
 Entry point for probe thread.


Detailed Description

The header file for the IP Probe MT.

This header file defines all macros and data structures.

Definition in file ipprobe-mt.h.


Define Documentation

#define CONN_RETRY_DEFAULT   32

Default connect retry

Definition at line 30 of file ipprobe-mt.h.

Referenced by probe_thrd_entry().

#define IP_HEADER_LEN   20

The IP header length, in byte

Definition at line 25 of file ipprobe-mt.h.

#define PROBE_LOG ( _level,
_fmt,
...   )     ERRMSG(IPPROBE-MT, (_level), _fmt, ##__VA_ARGS__)

The macro to log syslog message.

Definition at line 53 of file ipprobe-mt.h.

Referenced by probe_mngr_event_hdlr(), probe_mngr_open(), probe_mngr_probe_clear(), probe_mngr_probe_close_all(), probe_mngr_probe_result_get(), probe_mngr_probe_stop(), probe_thrd_entry(), and rspd_mngr_open().

#define PROBE_MGMT_MSG_ADD_DST   2

Add destination

Definition at line 33 of file ipprobe-mt.h.

Referenced by probe_mngr_msg_hdlr(), and probe_mngr_probe_start().

#define PROBE_MGMT_MSG_REG   1

Probe client registration

Definition at line 32 of file ipprobe-mt.h.

Referenced by probe_mngr_msg_hdlr().

#define PROBE_MNGR_PORT_DEFAULT   6068

TCP port for probe manager

Definition at line 28 of file ipprobe-mt.h.

Referenced by config_read(), and probe_mngr_init().

#define PROBE_NAME_LEN   64

The length of probe name

Definition at line 27 of file ipprobe-mt.h.

#define PROBE_PKT_COUNT_MAX   200

The max. count of probe packets

Definition at line 44 of file ipprobe-mt.h.

#define PROBE_PKT_REPLY   2

Probe reply packet

Definition at line 39 of file ipprobe-mt.h.

#define PROBE_PKT_REQ   1

Probe request packet

Definition at line 38 of file ipprobe-mt.h.

#define PROBE_PKT_REQ_LAST   3

The last probe request packet

Definition at line 40 of file ipprobe-mt.h.

#define PROBE_PKT_SIZE_MAX   1024

The max. size of probe packet

Definition at line 43 of file ipprobe-mt.h.

#define PROBE_PKT_SIZE_MIN   64

The min. size of probe packet

Definition at line 42 of file ipprobe-mt.h.

#define PROBE_PKT_TTL_DEFAULT   128

The default packet TTL

Definition at line 46 of file ipprobe-mt.h.

#define PROBE_TRACE ( _msg_type,
_fmt,
...   )     junos_trace((_msg_type), _fmt, ##__VA_ARGS__)

The macro to log tracing message.

Definition at line 49 of file ipprobe-mt.h.

Referenced by config_read(), main_init(), probe_mngr_event_hdlr(), probe_mngr_msg_hdlr(), probe_mngr_open(), probe_mngr_probe_close_all(), probe_mngr_probe_start(), probe_mngr_probe_stop(), probe_thrd_entry(), rspd_mngr_close(), rspd_mngr_init(), and rspd_mngr_open().

#define RSPD_MGMT_MSG_ACK   2

Request ACK

Definition at line 36 of file ipprobe-mt.h.

#define RSPD_MGMT_MSG_REQ   1

Request responder

Definition at line 35 of file ipprobe-mt.h.

#define RSPD_MNGR_PORT_DEFAULT   6069

UDP port for responder manager

Definition at line 29 of file ipprobe-mt.h.

Referenced by config_read(), and rspd_mngr_init().


Typedef Documentation

typedef struct probe_params_s probe_params_t

The structure of probe parameters.

typedef struct probe_rx_buf_s probe_rx_buf_t

The structure of Rx probe packet buffer.

typedef struct probe_s probe_t

The structure of probe.

typedef struct rspd_s rspd_t

The structure of responder.


Enumeration Type Documentation

enum probe_dst_state_t

The definitions of the state of probe.

Enumerator:
PROBE_DST_STATE_INIT  Probe is initialized
PROBE_DST_STATE_RUN  Probe is running
PROBE_DST_STATE_DONE  Probe is done

Definition at line 153 of file ipprobe-mt.h.


Function Documentation

int config_read ( int  check  ) 

Read daemon configuration from the database.

Parameters:
[in] check 1 if this function being invoked because of a commit check
Returns:
0 on success, -1 on failure
Note:
Do not use ERRMSG during config check.

Definition at line 98 of file ipprobe-mt_config.c.

References probe_mngr_port, PROBE_MNGR_PORT_DEFAULT, probe_params_clear(), PROBE_TRACE, rspd_mngr_port, and RSPD_MNGR_PORT_DEFAULT.

Referenced by main().

int probe_mngr_init ( evContext  lev_ctx  ) 

Initialize the probe manager.

Parameters:
[in] lev_ctx Event context
Returns:
0 on success, -1 on failure

Definition at line 409 of file ipprobe-mt_mngr.c.

References probe_mngr, and PROBE_MNGR_PORT_DEFAULT.

Referenced by main_init().

int probe_mngr_open ( uint16_t  port  ) 

Open the probe manager.

Parameters:
[in] port TCP port
Returns:
0 on success, -1 on failure

Definition at line 369 of file ipprobe-mt_mngr.c.

References probe_mngr_t::ev_ctx, probe_mngr_t::hdl, probe_mngr_t::port, PROBE_LOG, probe_mngr, probe_mngr_close(), probe_mngr_event_hdlr(), probe_mngr_msg_hdlr(), and PROBE_TRACE.

Referenced by LIST_HEAD().

int probe_mngr_probe_clear ( char *  name  ) 

Clear the probe.

Parameters:
[in] name Probe name
Returns:
0 on success, -1 on failure

Definition at line 314 of file ipprobe-mt_mngr.c.

References probe_s::dst_pat, probe_get_by_name(), PROBE_LOG, and probe_s::tid.

Referenced by clear_probe().

patroot* probe_mngr_probe_result_get ( char *  name  ) 

Get the result of the probe.

Parameters:
[in] name Probe name
Returns:
Pointer to the root of destination patricia tree, NULL on failure

Definition at line 248 of file ipprobe-mt_mngr.c.

References probe_s::dst_pat, probe_get_by_name(), and PROBE_LOG.

Referenced by show_probe().

int probe_mngr_probe_start ( char *  name,
in_addr_t  dst_addr 
)

Start the probe.

Parameters:
[in] name Probe name
[in] dst_addr Probe destination address
Returns:
0 on success, -1 on failure

Definition at line 197 of file ipprobe-mt_mngr.c.

References probe_s::dst_first, probe_params_s::dst_port, probe_params_s::pkt_count, probe_params_s::pkt_interval, probe_params_s::pkt_size, probe_get_by_name(), PROBE_MGMT_MSG_ADD_DST, probe_params_get(), probe_thrd_entry(), PROBE_TRACE, probe_params_s::proto, probe_s::ssn, and probe_s::tid.

Referenced by start_probe().

int probe_mngr_probe_stop ( char *  name  ) 

Stop the probe.

Parameters:
[in] name Probe name
Returns:
0 on success, -1 on failure

Definition at line 270 of file ipprobe-mt_mngr.c.

References probe_get_by_name(), PROBE_LOG, PROBE_TRACE, and probe_s::tid.

Referenced by stop_probe().

void* probe_thrd_entry ( probe_t probe  ) 

Entry point for probe thread.

Parameters:
[in] probe Pointer to the probe

Definition at line 895 of file ipprobe-mt_thrd.c.

References probe_s::client_hdl, CONN_RETRY_DEFAULT, probe_s::dst_pat, probe_params_s::dst_port, probe_s::ev_ctx, probe_params_s::name, probe_s::params, probe_params_s::pkt_count, probe_params_s::pkt_interval, probe_params_s::pkt_size, probe_mngr_t::port, PROBE_LOG, probe_mngr, probe_thrd_entry(), PROBE_TRACE, and probe_params_s::proto.

Referenced by probe_mngr_probe_start(), and probe_thrd_entry().

void rspd_mngr_close ( void   ) 

Close the responder manager.

Definition at line 300 of file ipprobe-mt_rspd.c.

References rspd_mngr_t::ev_ctx, PROBE_TRACE, rspd_mngr_t::read_fid, rspd_mngr_close(), and rspd_mngr_t::socket.

Referenced by main_exit(), rspd_mngr_close(), and rspd_mngr_open().

int rspd_mngr_init ( evContext  lev_ctx  ) 

Initialize the responder manager.

Parameters:
[in] lev_ctx Event context
Returns:
0 on success, -1 on failure

Definition at line 381 of file ipprobe-mt_rspd.c.

References PROBE_TRACE, rspd_mngr_init(), and RSPD_MNGR_PORT_DEFAULT.

Referenced by main_init(), and rspd_mngr_init().

int rspd_mngr_open ( uint16_t  port  ) 

Open the responder manager.

Parameters:
[in] port UDP port
Returns:
0 on success, -1 on failure

Definition at line 325 of file ipprobe-mt_rspd.c.

References rspd_mngr_t::ev_ctx, rspd_mngr_t::port, PROBE_LOG, PROBE_TRACE, rspd_mngr_t::read_fid, rspd_mngr_close(), rspd_mngr_open(), and rspd_mngr_t::socket.

Referenced by LIST_HEAD(), and rspd_mngr_open().


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 Probe MT: ipprobe-mt 1.0 by Doxygen 1.5.1