ipprobe-mt_mngr.c File Reference

The probe manager to manage probe threads. More...

#include <string.h>
#include <errno.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/queue.h>
#include <isc/eventlib.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <netinet/ip_icmp.h>
#include <jnx/aux_types.h>
#include <jnx/bits.h>
#include <jnx/patricia.h>
#include <jnx/pconn.h>
#include <jnx/junos_trace.h>
#include "ipprobe-mt.h"

Go to the source code of this file.

Functions

static LIST_HEAD (probe_s)
 Get a probe by client session.
static probe_tprobe_get_by_name (char *name)
 Get a probe by probe name.
static status_t probe_mngr_msg_hdlr (pconn_session_t *ssn, ipc_msg_t *msg, void *cookie UNUSED)
 Probe manager message handler.
static void probe_mngr_event_hdlr (pconn_session_t *ssn, pconn_event_t event, void *cookie UNUSED)
 Probe manager server event handler.
static void probe_mngr_probe_close_all (void)
 Close all probe threads.
int probe_mngr_probe_start (char *name, in_addr_t dst_addr)
 Start the probe.
patroot * probe_mngr_probe_result_get (char *name)
 Get the result of the probe.
int probe_mngr_probe_stop (char *name)
 Stop the probe.
int probe_mngr_probe_clear (char *name)
 Clear the probe.
void probe_mngr_close (void)
 Close the probe manager.
int probe_mngr_open (uint16_t port)
 Open the probe manager.
int probe_mngr_init (evContext lev_ctx)
 Initialize the probe manager.

Variables

probe_mngr_t probe_mngr


Detailed Description

The probe manager to manage probe threads.

These functions create the manager, manage probe threads, handle the connection and messages from probe threads and handle user commands from CLI.

Definition in file ipprobe-mt_mngr.c.


Function Documentation

static LIST_HEAD ( probe_s   )  [static]

Get a probe by client session.

Parameters:
[in] ssn Session
Returns:
Pointer to the probe on success, NULL on failure

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

References probe_s::ssn.

static probe_t* probe_get_by_name ( char *  name  )  [static]

Get a probe by probe name.

Parameters:
[in] name Probe name
Returns:
Pointer to the probe on success, NULL on failure

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

References probe_params_s::name, and probe_s::params.

Referenced by probe_mngr_msg_hdlr(), probe_mngr_probe_clear(), probe_mngr_probe_result_get(), probe_mngr_probe_start(), and probe_mngr_probe_stop().

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().


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