ped_ssd.h File Reference

Routines related to talking to SDK Services Deamon. More...

#include <sync/psd_ipc.h>

Go to the source code of this file.

Typedefs

typedef void(*) ssd_reply_notification_handler (ssd_reply_e reply, void *user_data)
 a callback function called when the result of a request to add or delete a route is available user_data is echoed.

Enumerations

enum  ssd_reply_e { ADD_SUCCESS, DELETE_SUCCESS, ADD_FAILED, DELETE_FAILED }
 applicable operations on interfaces More...

Functions

void ped_ssd_init (void)
void ped_ssd_shutdown (void)
boolean get_ssd_ready (void)
boolean ssd_client_add_route_request (policy_route_msg_t *route, ssd_reply_notification_handler func, void *user_data)
boolean ssd_client_del_route_request (policy_route_msg_t *route, ssd_reply_notification_handler func, void *user_data)
boolean get_ssd_idle (void)
void add_pfd_service_route (char *interface_name)
void delete_pfd_service_route (char *interface_name)
void add_service_route (char *interface_name, in_addr_t address)
void delete_service_route (char *interface_name, in_addr_t address)
void clean_routes (void)


Detailed Description

Routines related to talking to SDK Services Deamon.

Functions for connecting to SSD and add/delete route.

Definition in file ped_ssd.h.


Enumeration Type Documentation

enum ssd_reply_e

applicable operations on interfaces

Enumerator:
ADD_SUCCESS  request to add route succeeded
DELETE_SUCCESS  request to delete route succeeded
ADD_FAILED  request to add route failed
DELETE_FAILED  request to delete route failed

Definition at line 35 of file ped_ssd.h.


Function Documentation

void add_pfd_service_route ( char *  interface_name  ) 

Adds a default service route in the pfd_forwarding routing instance

Parameters:
[in] interface_name The name of the interface in the pfd_forwarding routing instance that the PFD uses

Definition at line 768 of file ped_service_route.c.

References route_info_s::address, route_info_s::client_ctx, client_nexthop_id, route_info_s::client_nh_id, DEFAULT_ROUTE_ADDRESS, DEFAULT_ROUTE_MASK, get_ifl_index(), route_info_s::ifl_index, INT_NAME_STR_SIZE, request_info_s::interface_name, route_info_s::mask, pfd_rt_tbl_id, request_info_s::req_action, route_info_s::rt_table_id, ssd_ready, and ssd_server_fd.

Referenced by ped_config_read(), and process_requests().

void add_service_route ( char *  interface_name,
in_addr_t  address 
)

Adds a service route to the default routing instance given the address assuming a /32 mask

Parameters:
[in] interface_name The name of the interface (next-hop) in the route used by the PFD when NAT'ing to CPD
[in] address The IP address used to create the service route with the /32 mask

Definition at line 906 of file ped_service_route.c.

References route_info_s::address, request_info_s::address, route_info_s::client_ctx, client_nexthop_id, route_info_s::client_nh_id, FULL_ROUTE_MASK, get_ifl_index(), route_info_s::ifl_index, INT_NAME_STR_SIZE, request_info_s::interface_name, route_info_s::mask, request_info_s::req_action, route_info_s::rt_table_id, rt_tbl_id, ssd_ready, and ssd_server_fd.

Referenced by ped_config_read(), and process_requests().

void clean_routes ( void   ) 

Clean up all routes created and shutdown this module

Definition at line 790 of file ped_ssd.c.

References MAX_UNCONFIRMED_CONTEXT, ssd_ready, and ssd_server_fd.

void delete_pfd_service_route ( char *  interface_name  ) 

Deletes a default service route in the pfd_forwarding routing instance

Parameters:
[in] interface_name The name of the interface in the pfd_forwarding routing instance that the PFD uses

Definition at line 833 of file ped_service_route.c.

References route_info_s::address, route_info_s::client_ctx, get_ifl_index(), route_info_s::ifl_index, INT_NAME_STR_SIZE, request_info_s::interface_name, route_info_s::mask, request_info_s::req_action, route_info_s::rt_table_id, ssd_ready, and ssd_server_fd.

Referenced by ped_config_read(), and process_requests().

void delete_service_route ( char *  interface_name,
in_addr_t  address 
)

Deletes a service route to the default routing instance given the address assuming a /32 mask

Parameters:
[in] interface_name The name of the interface (next-hop) in the route
[in] address The IP address used in the service route with the /32 mask

Definition at line 975 of file ped_service_route.c.

References route_info_s::address, request_info_s::address, route_info_s::client_ctx, get_ifl_index(), route_info_s::ifl_index, INT_NAME_STR_SIZE, request_info_s::interface_name, route_info_s::mask, request_info_s::req_action, route_info_s::rt_table_id, ssd_ready, and ssd_server_fd.

Referenced by ped_config_read(), and process_requests().

boolean get_ssd_idle ( void   ) 

Are there any outstanding requests to SSD for which we soon expect replies

Returns:
TRUE if there are NOT outstanding requests; FALSE if there are outstanding requests

Definition at line 568 of file ped_ssd.c.

References outstanding_requests.

Referenced by policy_table_clean(), and psd_ipc_read().

boolean get_ssd_ready ( void   ) 

Check the state of SSD connection.

Returns:
TRUE if connected to SSD, otherwise FALSE.

Definition at line 554 of file ped_ssd.c.

References ssd_ready.

Referenced by policy_table_clean(), and psd_ipc_read().

void ped_ssd_init ( void   ) 

Initialize client

Definition at line 502 of file ped_ssd.c.

References client_id, connect_ssd(), next_buffer, next_unconfirmed, outstanding_requests, ped_ctx, REQUESTS_BUFFER_SIZE, RETRY_CONNECT, rt_tbl_id, ssd_requests, ssd_server_fd, timer_id, UNCONFIRMED_CONTEXT, and ssd_request_t::user_data.

Referenced by ped_init().

void ped_ssd_shutdown ( void   ) 

Shutdown client

Definition at line 539 of file ped_ssd.c.

References ssd_server_fd.

boolean ssd_client_add_route_request ( policy_route_msg_t route,
ssd_reply_notification_handler  func,
void *  user_data 
)

Send message to SSD to add a route.

Parameters:
[in] route Pointer to route data.
[in] func function to callback when result is available
[in] user_data user data to echo in callback
Returns:
TRUE if request was accepted; FALSE if not due to no more buffers to store the request, or a KCOM problem, or ssd_request_route_add fails

Definition at line 591 of file ped_ssd.c.

References policy_route_msg_s::af, policy_route_msg_s::ifname, next_buffer, outstanding_requests, ssd_request_t::reply_handler, REQUESTS_BUFFER_SIZE, ssd_client_ifa_handler(), ssd_ready, ssd_requests, and ssd_request_t::user_data.

Referenced by add_route().

boolean ssd_client_del_route_request ( policy_route_msg_t route,
ssd_reply_notification_handler  func,
void *  user_data 
)

Send message to SSD to delete a route. This should be done with confirmation (func should handle the result). However, if our SSD confirmation-of-request buffers run out, then we return FALSE. In case of this, the caller can try calling the function again with func and user_data both NULL, but beware that no confirmation of the result will be provided, and the function will return TRUE unless libssd fails to accept it.

Parameters:
[in] route Pointer to route data.
[in] func function to callback when result is available. NULL if trying to delete without confirmation (caller will never know result if SSD accepts the reqest)
[in] user_data user data to echo in callback
Returns:
TRUE if request was accepted; FALSE if not due to no more buffers to store the request, or a KCOM problem, or ssd_request_route_delete fails

Definition at line 700 of file ped_ssd.c.

References MAX_UNCONFIRMED_CONTEXT, next_buffer, next_unconfirmed, outstanding_requests, ssd_request_t::reply_handler, REQUESTS_BUFFER_SIZE, policy_route_msg_s::route_addr, policy_route_msg_s::route_addr_prefix, rt_tbl_id, ssd_ready, ssd_requests, ssd_server_fd, UNCONFIRMED_CONTEXT, and ssd_request_t::user_data.

Referenced by remove_route(), and ssd_request_status().


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