ped_ui.c File Reference

Relating to the user interface (commands) of ped. More...

#include <sync/common.h>
#include <sync/psd_ipc.h>
#include <junoscript/xmllib_pub.h>
#include <junoscript/xmlrpc.h>
#include <junoscript/xmlstr.h>
#include <jnx/ssd_ipc_msg.h>
#include "ped_config.h"
#include "ped_filter.h"
#include "ped_logging.h"
#include "ped_kcom.h"
#include "ped_policy_table.h"
#include "ped_services.h"
#include "ped_service_route.h"
#include "ped_schedule.h"
#include "ped_ssd.h"

Go to the source code of this file.

Defines

#define FORMAT_TABLE   1
 display in table format
#define FORMAT_FAMILY   2
 display arranged by family
#define FORMAT_INTERFACE   3
 display arranged by interface
#define MAX_FAMILY_NAME_LENGTH   64
 max length of string for a family name

Functions

static char * itoa_family (int protocol_family)
static int fam_cmp (const void *ent1, const void *ent2)
static int intname_cmp (const void *ent1, const void *ent2)
static char * itoa_hop_type (uint8_t type)
static int32_t show_managed (mgmt_sock_t *msp, parse_status_t *csb, char *unparsed __unused)

Variables

static const parse_menu_t show_sync_pe_level_menu []
static const parse_menu_t show_sync_pe_menu []
static const parse_menu_t show_sync_menu []
static const parse_menu_t show_menu []
const parse_menu_t master_menu []


Detailed Description

Relating to the user interface (commands) of ped.

Contains callback functions that get executed by commands on the router

Definition in file ped_ui.c.


Function Documentation

static int fam_cmp ( const void *  ent1,
const void *  ent2 
) [static]

Compare interface family given two table entries

Parameters:
[in] ent1 Table entry one
[in] ent2 Table entry two
Returns:
an integer greater than, equal to, or less than 0, accordingly as the family in ent1 is greater than, equal to, or less than the the family in ent2; or if the family if the same, then it compares/sorts by interface name.

Definition at line 105 of file ped_ui.c.

References policy_table_entry_s::af, and policy_table_entry_s::ifname.

Referenced by show_managed().

static int intname_cmp ( const void *  ent1,
const void *  ent2 
) [static]

Compare interface names given two table entries

Parameters:
[in] ent1 Table entry one
[in] ent2 Table entry two
Returns:
integer result of strcmp between interface names; or if the family if the same, then it compares/sorts by interface name.

Definition at line 131 of file ped_ui.c.

References policy_table_entry_s::af, and policy_table_entry_s::ifname.

Referenced by show_managed().

static char* itoa_family ( int  protocol_family  )  [static]

Get a string from an interger for the family.

Parameters:
[in] protocol_family The protocol family for which a string is desired
Returns:
statically allocated char * represenation (good until next call).

Definition at line 66 of file ped_ui.c.

References MAX_FAMILY_NAME_LENGTH.

Referenced by show_managed().

static char* itoa_hop_type ( uint8_t  type  )  [static]

Convert next-hop type to string.

Parameters:
[in] type Next-hop type.
Returns:
String pointer to next-hop type.

Definition at line 153 of file ped_ui.c.

Referenced by show_managed().

static int32_t show_managed ( mgmt_sock_t *  msp,
parse_status_t *  csb,
char *unparsed  __unused 
) [static]

Displays the managed interfaces

Parameters:
[in] msp management socket pointer
[in] csb parsed info status (contains subcodes/arguments)
[in] unparsed unparsed command string
Returns:
0 if no error; 1 to terminate connection

Definition at line 185 of file ped_ui.c.

References policy_table_entry_s::af, fam_cmp(), policy_table_entry_s::filter, ped_policy_filter_s::filter_data, FORMAT_FAMILY, FORMAT_INTERFACE, FORMAT_TABLE, policy_table_entry_s::ifname, policy_filter_msg_s::input_filter, intname_cmp(), is_pfd_filter_on(), itoa_family(), itoa_hop_type(), policy_filter_msg_s::output_filter, policy_table_entry_count(), policy_table_iterator_reset(), policy_table_next(), policy_table_entry_s::route, policy_route_msg_s::route_addr, and ped_policy_route_s::route_data.


Variable Documentation

const parse_menu_t master_menu[]

Initial value:

 
{
    { "show", NULL, 0, show_menu, NULL },
    { NULL, NULL, 0, NULL, NULL }
}
main menu of commands

Definition at line 460 of file ped_ui.c.

Referenced by main().

const parse_menu_t show_menu[] [static]

Initial value:

 
{
    { "sync", NULL, 0, show_sync_menu, NULL },
    { NULL, NULL, 0, NULL, NULL }
}
"show ..." commands

Definition at line 451 of file ped_ui.c.

const parse_menu_t show_sync_menu[] [static]

Initial value:

 
{
    { "policy-enforcement", NULL, 0, show_sync_pe_menu, NULL },
    { NULL, NULL, 0, NULL, NULL }
}
"show sync ..." commands

Definition at line 442 of file ped_ui.c.

const parse_menu_t show_sync_pe_level_menu[] [static]

Initial value:

 
{
    { "by-family", NULL, FORMAT_FAMILY, NULL, show_managed },
    { "by-interface", NULL, FORMAT_INTERFACE, NULL, show_managed },
    { "table", NULL, FORMAT_TABLE, NULL, show_managed },
    { NULL, NULL, 0, NULL, NULL }
}
"show sync policy-enforcement managed-interfaces ..." commands

Definition at line 422 of file ped_ui.c.

const parse_menu_t show_sync_pe_menu[] [static]

Initial value:

 
{
    { "managed-interfaces", NULL, 0, show_sync_pe_level_menu, NULL },
    { NULL, NULL, 0, NULL, NULL }
}
"show sync policy-enforcement ..." commands

Definition at line 433 of file ped_ui.c.


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:06 2010 for SDK Your Net Corporation Policy Manager Example: Policy Enforcement Daemon 1.0 by Doxygen 1.5.1