ssd_ipc_msg.h File Reference

Contains defines, structures, and function prototypes for adding and deleting routes. More...

#include <jnx/jnx_types.h>

Data Structures

union  ssd_sockaddr_un_
 Generic address structure, used only for referencing length and family. More...
struct  ssd_rt_metrics
 Route metric structure. More...
struct  ssd_rt_gateway
 Route gateway structure. More...
struct  ssd_route_parms
 Route structure for route addition. More...
struct  ssd_rt_delete_parms
 Route structure for route deletion. More...
struct  ssd_nh_opq_data
 Structure for passing private data to the next hop. More...
struct  ssd_nh_add_parms
 Structure for next hop addition. More...
struct  ssd_route_lookup_parms
 Route lookup parameters. More...
struct  ssd_rt_lookup_reply_head_msg
 Route lookup reply message. More...
struct  ssd_rt_lookup_reply_route_entry_msg
 Route entry message passed with the route lookup reply. More...
struct  ssd_rt_lookup_reply_gtway_entry_msg
 A single next hop. More...
struct  ssd_rt_lookup_reply_as_msg
 AS number. More...

Defines

#define SSD_REQUEST_UNDEFINED   0
 Undefined SSD request.
#define SSD_REPLY_UNDEFINED   0
 Undefined SSD response.
#define SSD_REPLY_NO_ERR   0
 SSD response with no error.
#define SSD_GET_SESSION_ID   1
 SSD client request to get a session ID.
#define SSD_ROUTE_REQUEST   2
 SSD client request to perform route management.
#define SSD_SETUP_ROUTE_SERVICE   1
 SSD client route request subtype to set up a route service.
#define SSD_CLEAN_UP_ROUTE_SERVICE   2
 SSD client route request subtype to clean up a route service.
#define SSD_ROUTE_REQ_TABLE_LOOKUP   3
 SSD client route request subtype to look up a route table name-to-ID mapping.
#define SSD_ROUTE_REQ_ADD   4
 SSD client route request subtype to add a route.
#define SSD_ROUTE_REQ_DELETE   5
 SSD client route request subtype to delete a route.
#define SSD_ROUTE_REQ_SERVICE_ROUTE_ADD   6
 SSD client route request subtype to add a route with a service next hop.
#define SSD_ROUTE_REQ_SERVICE_ROUTE_DELETE   7
 SSD client route request subtype to delete a route with a service next hop.
#define SSD_ROUTE_REQ_NH_ADD   8
 SSD client route request subtype to add a nexthop.
#define SSD_ROUTE_REQ_NH_DELETE   9
 SSD client route request subtype to delete a nexthop.
#define SSD_ROUTE_LOOKUP   10
 SSD client route request subtype to look up a route.
#define SSD_SESSION_ID_REPLY   1
 SSD server session ID reply message type.
#define SSD_ROUTE_SERVICE_REPLY   2
 SSD server route request reply message type.
#define SSD_ROUTE_SERVICE_CLEAN_UP_REPLY   3
 SSD server route service cleanup reply message type.
#define SSD_SETUP_ROUTE_SERVICE_REPLY   4
 SSD server route service setup reply message type.
#define SSD_ROUTE_TABLE_LOOKUP_REPLY   5
 SSD server routing table lookup reply message type.
#define SSD_ROUTE_ADD_REPLY   6
 SSD server route add reply message type.
#define SSD_ROUTE_DELETE_REPLY   7
 SSD server route delete reply message type.
#define SSD_NH_ADD_REPLY   8
 SSD server nexthop add reply message type.
#define SSD_NH_DELETE_REPLY   9
 SSD server nexthop delete reply message type.
#define SSD_ROUTE_LOOKUP_REPLY   10
 SSD server route lookup reply message type.
#define SSD_SESSION_SUCCESS   1
 SSD server generic reply for an action success.
#define SSD_SESSION_FAILED   2
 SSD server generic reply for an action failure.
#define SSD_SESSION_CLIENT_ID_RESTORED   3
 SSD server restored the client ID of the reconnecting client.
#define SSD_SESSION_ID_REPLY_STATUS_ARG   0
 Argument number for the status of client ID reply.
#define SSD_SESSION_ID_REPLY_CLIENT_ID_ARG   1
 Argument number for the client ID in the client ID reply.
#define SSD_SESSION_ID_REPLY_ERR_CODE   2
 Argument number to get the error code in the client ID reply.
#define SSD_SESSION_DUPLICATE_CLIENT_ID   1
 The SSD server already has a client with the same ID as the one requested.
#define SSD_SESSION_INVALID_CLIENT_ID   2
 Requested client does not have a client ID registered with the SSD server.
#define SSD_SESSION_CLIENT_ID_EEXIST   3
 The SSD server already has assigned a client ID for the client.
#define SSD_SESSION_MAX_CLIENT_CONNECTED   4
 The SSD server reached a limit for the max client ID.
#define SSD_SESSION_ID_REPLY_CHECK_STATUS(cmsg)
 Returns 1 if the client ID request is successful: that is, either a new client ID for a new client or an existing client ID for a reconnecting client.
#define SSD_SESSION_ID_REPLY_GET_STATUS(cmsg)   (cmsg->ssd_ipc_args[SSD_SESSION_ID_REPLY_STATUS_ARG])
 Returns the client ID status of the reply.
#define SSD_SESSION_ID_REPLY_GET_CLIENT_ID(cmsg)   (cmsg->ssd_ipc_args[SSD_SESSION_ID_REPLY_CLIENT_ID_ARG])
 Returns the client ID from the reply.
#define SSD_SESSION_ID_REPLY_GET_ERROR_CODE(cmsg)   (cmsg->ssd_ipc_args[SSD_SESSION_ID_REPLY_ERR_CODE])
 Returns the error code from the client ID reply.
#define SSD_ROUTE_SERVICE_REPLY_STATUS_ARG   0
 Argument number for the status of the route service request.
#define SSD_ROUTE_SERVICE_REPLY_ERR_CODE   1
 Argument number for the error code of the route service request in the case of a failure.
#define SSD_ROUTE_SERVICE_INVALID_CLIENT_ID   1
 route service request is from a client who does not have a valid client ID registered with the SSD server
#define SSD_ROUTE_SERVICE_EEXIST   2
 The SSD server already has a valid route service for this client.
#define SSD_ROUTE_SERVICE_MEM_ALLOC_FAILED   3
 The SSD server failed to allocate memory.
#define SSD_ROUTE_SERVICE_RESET   4
 The SSD server replies with this error code when the route service for the client is no longer valid.
#define SSD_ROUTE_SERVICE_PENDING   5
 The SSD server already has a route service for this client and is in the process of registering with the to register with the routing protocol daemon.
#define SSD_ROUTE_SERVICE_REPLY_CHECK_STATUS(cmsg)
 Returns 1 if the route service setup request is successful, otherwise returns 0.
#define SSD_ROUTE_SERVICE_REPLY_GET_STATUS(cmsg)   (cmsg->ssd_ipc_args[SSD_ROUTE_SERVICE_REPLY_STATUS_ARG])
 Returns the route service status of the reply.
#define SSD_ROUTE_SERVICE_REPLY_GET_ERROR_CODE(cmsg)   (cmsg->ssd_ipc_args[SSD_ROUTE_SERVICE_REPLY_ERR_CODE])
 Returns the route service error code in the reply upon failure.
#define SSD_ROUTE_SERVICE_CLEAN_UP_STATUS_ARG   0
 Argument number for the status of the route service cleanup operation in a route service reply.
#define SSD_ROUTE_SERVICE_CLEAN_UP_CTX_ARG   1
 Argument number for the client context in a route service cleanup reply.
#define SSD_ROUTE_SERVICE_CLEAN_UP_ERR_CODE   2
 Argument number for the error code of the route service cleanup requestupon failure.
#define SSD_ROUTE_SERVICE_CLEAN_UP_INVALID_CLIENT_ID   1
 route service cleanup request is from a client that does not have a valid client ID registered with the SSD server
#define SSD_ROUTE_SERVICE_CLEAN_UP_ROUTE_SERVICE_INVALID   2
 The SSD server does not have a valid route service for this client.
#define SSD_ROUTE_SERVICE_CLEAN_UP_RPD_PROTOCOL_INVALID   3
 The SSD server is still not able to complete the route service request for this client, so this request cannot be processed until the route service is properly established.
#define SSD_ROUTE_SERVICE_CLEAN_UP_FAILED   4
 The SSD server was not able to complete the route service cleanup request due to an error with the JUNOS routing protocol daemon.
#define SSD_ROUTE_SERVICE_CLEAN_UP_REPLY_CHECK_STATUS(cmsg)
 Returns 1 if the route service cleanup request is successful, otherwise returns 0.
#define SSD_ROUTE_SERVICE_CLEAN_UP_REPLY_GET_CLIENT_CTX(cmsg)   (cmsg->ssd_ipc_args[SSD_ROUTE_SERVICE_CLEAN_UP_CTX_ARG])
 Gets the client context from the route service cleanup reply.
#define SSD_ROUTE_SERVICE_CLEAN_UP_REPLY_GET_ERROR_CODE(cmsg)   (cmsg->ssd_ipc_args[SSD_ROUTE_SERVICE_CLEAN_UP_ERR_CODE])
 Gets the client context from the route service cleanup reply.
#define SSD_ROUTE_TABLE_LOOKUP_REPLY_STATUS_ARG   0
 Argument number for the status of route table lookup operation in a route table lookup reply.
#define SSD_ROUTE_TABLE_LOOKUP_REPLY_CTX_ARG   1
 Argument number for client context in a route table lookup reply.
#define SSD_ROUTE_TABLE_LOOKUP_REPLY_RTTID_ARG   2
 Argument number for route table ID returned in the route table lookup reply.
#define SSD_ROUTE_TABLE_LOOKUP_REPLY_ERR_CODE   3
 Argument number for error code for failure of route table lookup operation in a route table lookup reply.
#define SSD_ROUTE_TABLE_LOCATE_RETURN_NOTFOUND   1
 not able to locate routing table
#define SSD_ROUTE_TABLE_LOCATE_INVALID_CLIENT_ID   5
 route table locate request is from a client who does not have a valid client ID registered with the SSD server
#define SSD_ROUTE_TABLE_LOCATE_ROUTE_SERVICE_INVALID   6
 The SSD server does not have a valid route service for this client in order to process this request.
#define SSD_ROUTE_TABLE_LOCATE_RPD_PROTOCOL_INVALID   7
 The SSD server is still not able to complete the route service request for this client so this request can not be processed at this time until route service is setup properly.
#define SSD_ROUTE_TABLE_LOCATE_DUPLICATE_CONTEXT   8
 The SSD server is already processing another request with the same client context.
#define SSD_ROUTE_TABLE_LOCATE_MEM_ALLOC_FAILED   9
 The SSD server failed to allocate memory.
#define SSD_ROUTE_TABLE_LOOKUP_REPLY_CHECK_STATUS(cmsg)
 Returns 1 if the route table lookup request is successful, otherwise returns 0.
#define SSD_ROUTE_TABLE_LOOKUP_REPLY_GET_CLIENT_CTX(cmsg)   (cmsg->ssd_ipc_args[SSD_ROUTE_TABLE_LOOKUP_REPLY_CTX_ARG])
 Gets the client context from the route table lookup reply.
#define SSD_ROUTE_TABLE_LOOKUP_REPLY_GET_RTTID(cmsg)   (cmsg->ssd_ipc_args[SSD_ROUTE_TABLE_LOOKUP_REPLY_RTTID_ARG])
 Gets the route table ID from the route table lookup reply.
#define SSD_ROUTE_TABLE_LOOKUP_REPLY_GET_ERROR_CODE(cmsg)
 Returns the error code for route table lookup failure, if route table lookup is successful returns 0.
#define SSD_ROUTE_ADD_REPLY_STATUS_ARG   0
 Argument number for the status of route add operation returned in route add reply.
#define SSD_ROUTE_ADD_REPLY_CTX_ARG   1
 Argument number for the client context in a route add reply.
#define SSD_ROUTE_ADD_REPLY_ERR_CODE   2
 Argument number for error code returned in a route add reply upon route add operation failure.
#define SSD_ROUTE_ADD_RETURN_TABLEID_INVALID   2
 route add failure for invalid routing table ID
#define SSD_ROUTE_ADD_RETURN_IFLIDX_INVALID   3
 route add failure for invalid interface index
#define SSD_ROUTE_ADD_RETURN_LCLADDR_INVALID   4
 route add failure for invalid local address
#define SSD_ROUTE_ADD_RETURN_PREFIX_INVALID   5
 route add failure for invalid route prefix
#define SSD_ROUTE_ADD_RETURN_MASK2SHORT   8
 route add failure for mask too short
#define SSD_ROUTE_ADD_RETURN_BAD_NEXTHOP   9
 route add failure for invalid nexthop
#define SSD_ROUTE_ADD_INVALID_CLIENT_ID   20
 route add request is from a client who does not have a valid client ID registered with the SSD server
#define SSD_ROUTE_ADD_ROUTE_SERVICE_INVALID   21
 The SSD server does not have a valid route service for this client in order to process this request.
#define SSD_ROUTE_ADD_RPD_PROTOCOL_INVALID   22
 The SSD server is still not able to complete the route service request for this client so this request can not be processed at this time until route service is setup properly.
#define SSD_ROUTE_ADD_DUPLICATE_CONTEXT   23
 The SSD server is already processing another request with the same client context.
#define SSD_ROUTE_ADD_MEM_ALLOC_FAILED   24
 The SSD server failed to allocate memory.
#define SSD_ROUTE_ADD_REPLY_CHECK_STATUS(cmsg)
 Returns 1 if the route add request is successful, otherwise returns 0.
#define SSD_ROUTE_ADD_REPLY_GET_CLIENT_CTX(cmsg)   (cmsg->ssd_ipc_args[SSD_ROUTE_ADD_REPLY_CTX_ARG])
 Gets the client context from the route add reply.
#define SSD_ROUTE_ADD_REPLY_GET_ERROR_CODE(cmsg)
 Returns the error code for route add failure; if route add is successful, returns 0.
#define SSD_ROUTE_DELETE_REPLY_STATUS_ARG   0
 Argument number for the status of route delete operation returned in a route delete reply.
#define SSD_ROUTE_DELETE_REPLY_CTX_ARG   1
 Argument number for the client context in a route delete reply.
#define SSD_ROUTE_DELETE_REPLY_ERR_CODE   2
 Argument number for error code returned in a route delete reply upon route delete operation failure.
#define SSD_ROUTE_DELETE_RETURN_ROUTE_NOTFOUND   1
 Unable to find the route to delete.
#define SSD_ROUTE_DELETE_RETURN_TABLE_NOTFOUND   2
 Unable to find the routing table to delete the route.
#define SSD_ROUTE_DELETE_INVALID_CLIENT_ID   10
 Route delete request is from a client that does not have a valid client ID registered with the SSD server.
#define SSD_ROUTE_DELETE_ROUTE_SERVICE_INVALID   11
 The SSD server does not have a valid route service for this client that allows it to process this request.
#define SSD_ROUTE_DELETE_RPD_PROTOCOL_INVALID   12
 The SSD server is unable to complete the route service request for this client until the route service is properly set up.
#define SSD_ROUTE_DELETE_DUPLICATE_CONTEXT   13
 The SSD server is already processing another request with the same client context.
#define SSD_ROUTE_DELETE_MEM_ALLOC_FAILED   14
 The SSD server failed to allocate memory.
#define SSD_ROUTE_DELETE_REPLY_CHECK_STATUS(cmsg)
 Returns 1 if the route delete request is successful, otherwise returns 0.
#define SSD_ROUTE_DELETE_REPLY_GET_CLIENT_CTX(cmsg)   (cmsg->ssd_ipc_args[SSD_ROUTE_DELETE_REPLY_CTX_ARG])
 Gets the client context from the route delete reply.
#define SSD_ROUTE_DELETE_REPLY_GET_ERROR_CODE(cmsg)
 Returns the error code in case of route delete failure.
#define SSD_NH_ADD_REPLY_STATUS_ARG   0
 Argument number for the status of nexthop add operation.
#define SSD_NH_ADD_REPLY_CTX_ARG   1
 Argument number for the client context of nexthop add operation reply.
#define SSD_NH_ADD_REPLY_NH_ID_ARG   2
 Argument number for the nexthop ID of a nexthop add operation reply.
#define SSD_NH_ADD_REPLY_ERR_CODE   3
 Argument number for the error code of a nexthop add operation failure.
#define SSD_NH_ADD_INVALID_CLIENT_ID   1
 nexthop add request is from a client who does not have a valid client ID registered with the SSD server
#define SSD_NH_ADD_ROUTE_SERVICE_INVALID   2
 The SSD server does not have a valid route service for this client in order to process this request.
#define SSD_NH_ADD_RPD_PROTOCOL_INVALID   3
 The SSD server is still not able to complete the route service request for this client so this request can not be processed at this time until route service is setup properly.
#define SSD_NH_ADD_DUPLICATE_CONTEXT   4
 The SSD server is already processing another request with the same client context.
#define SSD_NH_ADD_FAILED   5
 The SSD server failed to add a nexthop due to an internal error; or the might already exist.
#define SSD_NEXTHOP_ADD_REPLY_CHECK_STATUS(cmsg)
 Returns 1 if the nexthop add request is successful, otherwise returns 0.
#define SSD_NEXTHOP_ADD_REPLY_GET_CLIENT_CTX(cmsg)   (cmsg->ssd_ipc_args[SSD_NH_ADD_REPLY_CTX_ARG])
 Gets the client context from the nexthop add reply.
#define SSD_NEXTHOP_ADD_REPLY_GET_NH_ID(cmsg)   (cmsg->ssd_ipc_args[SSD_NH_ADD_REPLY_NH_ID_ARG])
 Gets the SSD nexthop ID from the nexthop add reply.
#define SSD_NEXTHOP_ADD_REPLY_GET_ERROR_CODE(cmsg)   (cmsg->ssd_ipc_args[SSD_NH_ADD_REPLY_ERR_CODE])
 Gets the error code for the nexthop operation failure from the nexthop add reply.
#define SSD_NH_DELETE_REPLY_STATUS_ARG   0
 Argument number for the status of a nexthop delete reply.
#define SSD_NH_DELETE_REPLY_CTX_ARG   1
 Argument number for the client context of a nexthop delete reply.
#define SSD_NH_DELETE_REPLY_ERR_CODE   2
 Argument number for the error code of a nexthop delete operation failure.
#define SSD_NH_DELETE_INVALID_CLIENT_ID   1
 The nexthop delete request is from a client that does not have a valid client ID registered with the SSD server.
#define SSD_NH_DELETE_ROUTE_SERVICE_INVALID   2
 The SSD server does not have a valid route service for this client that allows it to process this request.
#define SSD_NH_DELETE_RPD_PROTOCOL_INVALID   3
 The SSD server is unable to complete the route service request for this client.
#define SSD_NH_DELETE_DUPLICATE_CONTEXT   4
 The SSD server is already processing another request with the same client context.
#define SSD_NEXTHOP_DELETE_REPLY_CHECK_STATUS(cmsg)
 Returns 1 if the nexthop delete request is successful, otherwise returns 0.
#define SSD_NEXTHOP_DELETE_REPLY_GET_CLIENT_CTX(cmsg)   (cmsg->ssd_ipc_args[SSD_NH_DELETE_REPLY_CTX_ARG])
 Gets the client context from the nexthop delete reply.
#define SSD_NEXTHOP_DELETE_REPLY_GET_ERROR_CODE(cmsg)   (cmsg->ssd_ipc_args[SSD_NH_DELETE_REPLY_ERR_CODE])
 Gets the client context from the nexthop delete reply.
#define SSD_ROUTE_LOOKUP_REPLY_STATUS_ARG   0
 Argument number for the status of route lookup operation returned in a route lookup reply.
#define SSD_ROUTE_LOOKUP_REPLY_CTX_ARG   1
 Argument number for the client context in a route lookup reply.
#define SSD_ROUTE_LOOKUP_REPLY_ERR_CODE   2
 Argument number for the error code returned in a route lookup reply in case of a route lookup operation failure.
#define SSD_ROUTE_LOOKUP_RETURN_TABLE_NOTFOUND   1
 Specified route table not found.
#define SSD_ROUTE_LOOKUP_RETURN_PREFIX_INVALID   2
 Prefix for which route lookup was performed is invalid.
#define SSD_ROUTE_LOOKUP_RETURN_PREFIX_NOTFOUND   3
 Prefix for which route lookup was performed is not found in the specified route table.
#define SSD_ROUTE_LOOKUP_INVALID_CLIENT_ID   10
 The route lookup request is from a client that does not have a valid client ID registered with the SSD server.
#define SSD_ROUTE_LOOKUP_ROUTE_SERVICE_INVALID   11
 The SSD server does not have a valid route service for this client that allows it to process the request.
#define SSD_ROUTE_LOOKUP_RPD_PROTOCOL_INVALID   12
 The SSD server is unable to complete the route service request for this client.
#define SSD_ROUTE_LOOKUP_DUPLICATE_CONTEXT   13
 The SSD server is already processing another request with the same client context.
#define SSD_ROUTE_LOOKUP_MEM_ALLOC_FAILED   14
 The SSD server failed to allocate memory.
#define SSD_ROUTE_LOOKUP_REPLY_CHECK_STATUS(cmsg)
 Returns 1 if the route lookup request is successful, otherwise returns 0.
#define SSD_ROUTE_LOOKUP_REPLY_GET_CLIENT_CTX(cmsg)   (cmsg->ssd_ipc_args[SSD_ROUTE_LOOKUP_REPLY_CTX_ARG])
 Gets the client context from the route lookup reply.
#define SSD_ROUTE_LOOKUP_REPLY_GET_ERROR_CODE(cmsg)
 Returns the error code for route lookup failure; if the route lookup is successful, returns 0.
#define SSD_NEXTHOP_PKT_DIST_RR   0
 Round robin distribution of packets.
#define SSD_NEXTHOP_PKT_DIST_FA   1
 Flow affinity distribution of packets.
#define SSD_NEXTHOP_DST_FLAG_CTRL   2
#define SSD_ROUTE_N_MULTIPATH   16
 Maximum number of next hops.
#define SSD_ROUTE_METRICS_NORMAL   4
 Normal matrix for a route.
#define SSD_RTM_VALUE_PRESENT   0x80
 Set the rtm_type in a Route Metric (rt_metric) structure to this value to indicate that a corresponding rtm_val is present.
#define SSD_RNH_DISCARD   0
 Next hop types, possible values for rta_nhtype Quietly discard the packet.
#define SSD_RNH_REJECT   1
 Discard the packet with error notification.
#define SSD_RNH_UNICAST   2
 Unicast next hop.
#define SSD_RNH_TABLE   15
 Another routing table as Next hop.
#define SSD_RNH_SERVICE   22
 Service next hop.
#define SSD_ROUTE_ADD_FLAG_OVERWRITE   0x1
 Flags types, possible values for rta_flags Overwrite the route with the new one if one exists.
#define SSD_RTS_STATE_NOTINSTALL   0x0400
 Don't install route in kernel.
#define SSD_RTS_STATE_NOADVISE   0x0800
 Don't advertise route to neighbors.
#define SSD_RTS_STATE_INTERIOR   0x4000
 An interior route.
#define NBBY   8
 The following are tha macros to use to get to the different fields in the ssd_rt_lookup_reply_head_msg structure received after a successful route lookup.
#define SSD_ROUNDUP_BIT(x)
#define SSD_ROUND_BIT(x)   (SSD_ROUNDUP_BIT((x)) * sizeof(u_int32_t))
#define SSD_ROUNDUP(x)   (((u_int)(x) + sizeof(u_int32_t) - 1) / sizeof(u_int32_t))
#define SSD_ROUND(x)   (SSD_ROUNDUP((x)) * sizeof(u_int32_t))
#define SSD_RT_LOOKUP_REPLY_HEAD_MSG_INFO(msg)   ((u_int32_t *) (void *)((u_int8_t *)(msg) + (msg)->rthm_info_off))
#define SSD_RT_LOOKUP_REPLY_HEAD_MSG_PREFIX(msg)   ((u_int8_t *) SSD_RT_LOOKUP_REPLY_HEAD_MSG_INFO(msg))
#define SSD_RT_LOOKUP_REPLY_HEAD_MSG_ROUTE(msg)
#define SSD_RT_LOOKUP_REPLY_ROUTE_ENTRY_MSG_NEXT(msg)
#define SSD_RT_LOOKUP_REPLY_ROUTE_ENTRY_MSG_AS(msg)
#define SSD_RT_LOOKUP_REPLY_ROUTE_ENTRY_MSG_AS_NEXT(msg)
#define SSD_RT_LOOKUP_REPLY_ROUTE_ENTRY_MSG_GTWAY_ENTRY(msg)
#define SSD_RT_LOOKUP_REPLY_GTWAY_ENTRY_MSG_ADDR(msg)   ((u_int8_t *) (msg) + (msg)->rtgm_info_off)
#define SSD_RT_LOOKUP_REPLY_GTWAY_ENTRY_MSG_LCLADDR(msg)

Typedefs

typedef enum ssd_sockaddr_type_ ssd_sockaddr_type
 SSD socket type.
typedef u_int32_t ssd_in_addr
 SSD address type.
typedef u_int16_t ssd_in_port
 SSD port type.
typedef u_int32_t ssd_rt_tableid
 SSD route table ID type.
typedef ssd_sockaddr_un_ ssd_sockaddr_un
 Generic socket.

Enumerations

enum  ssd_sockaddr_type_ { SSD_GF_UNSPEC = 0, SSD_GF_INET = 1, SSD_GF_MAX = 2 }

Functions

static void ssd_setsocktype (ssd_sockaddr_un *sun, ssd_sockaddr_type type)
 Function to set up the socket type on a particular socket.
int ssd_get_client_id (int fd, int client_id)
 Requests a client ID from the SSD server.
int ssd_setup_route_service (int fd)
 Sends a request to the SSD server to set up a route service.
int ssd_clean_up_route_service (int fd, unsigned int client_ctx)
 Sends a request to the SSD server to clean up a previously set-up route service.
int ssd_request_route_table_lookup (int fd, char *ribname, unsigned int client_ctx)
 Sends a request to the SSD server to look up the routing table ID, given the routing table name.
int ssd_request_route_add (int fd, struct ssd_route_parms *rtp, unsigned int client_ctx)
 Sends a request to the SSD server to add a route.
int ssd_request_route_delete (int fd, const struct ssd_rt_delete_parms *rtp, unsigned int client_ctx)
 Sends a request to the SSD server to delete a route.
int ssd_request_nexthop_add (int fd, int client_nexthop_id, struct ssd_nh_add_parms *parms, unsigned int client_ctx)
 Sends a request to the SSD server to add a nexthop.
int ssd_request_nexthop_delete (int fd, int client_nexthop_id, nh_idx_t ssd_nh_id, unsigned int client_ctx)
 Sends a request to the SSD server to delete a next hop.
int ssd_request_route_lookup (int fd, const struct ssd_route_lookup_parms *rtlp, unsigned int client_ctx)
 Sends a request to the SSD server to perform a route lookup.


Detailed Description

Contains defines, structures, and function prototypes for adding and deleting routes.


Define Documentation

#define SSD_NEXTHOP_ADD_REPLY_CHECK_STATUS cmsg   ) 
 

Value:

((cmsg->ssd_ipc_args[SSD_NH_ADD_REPLY_STATUS_ARG] == \
            SSD_SESSION_SUCCESS) ? 1 : 0)
Returns 1 if the nexthop add request is successful, otherwise returns 0.

#define SSD_NEXTHOP_DELETE_REPLY_CHECK_STATUS cmsg   ) 
 

Value:

((cmsg->ssd_ipc_args[SSD_NH_DELETE_REPLY_STATUS_ARG] == \
            SSD_SESSION_SUCCESS) ? 1 : 0)
Returns 1 if the nexthop delete request is successful, otherwise returns 0.

#define SSD_NH_ADD_RPD_PROTOCOL_INVALID   3
 

The SSD server is still not able to complete the route service request for this client so this request can not be processed at this time until route service is setup properly.

In this case client has to retry some other time

#define SSD_NH_DELETE_RPD_PROTOCOL_INVALID   3
 

The SSD server is unable to complete the route service request for this client.

The request cannot be processed until the route service is properly set up. The client should retry at another time.

#define SSD_ROUNDUP_BIT  ) 
 

Value:

(((u_int)(x) + (sizeof(u_int32_t) * NBBY - 1)) \
                 / (sizeof(u_int32_t) * NBBY))

#define SSD_ROUTE_ADD_REPLY_CHECK_STATUS cmsg   ) 
 

Value:

((cmsg->ssd_ipc_args[SSD_ROUTE_ADD_REPLY_STATUS_ARG] == \
            SSD_SESSION_SUCCESS) ? 1 : 0)
Returns 1 if the route add request is successful, otherwise returns 0.

#define SSD_ROUTE_ADD_REPLY_GET_ERROR_CODE cmsg   ) 
 

Value:

((cmsg->ssd_ipc_args[SSD_ROUTE_ADD_REPLY_STATUS_ARG] == \
            SSD_SESSION_FAILED) ?  \
            (cmsg->ssd_ipc_args[SSD_ROUTE_ADD_REPLY_ERR_CODE]) : \
            0)
Returns the error code for route add failure; if route add is successful, returns 0.

#define SSD_ROUTE_ADD_RPD_PROTOCOL_INVALID   22
 

The SSD server is still not able to complete the route service request for this client so this request can not be processed at this time until route service is setup properly.

In this case client has to retry some other time

#define SSD_ROUTE_DELETE_REPLY_CHECK_STATUS cmsg   ) 
 

Value:

((cmsg->ssd_ipc_args[SSD_ROUTE_DELETE_REPLY_STATUS_ARG] == \
            SSD_SESSION_SUCCESS) ? 1 : 0)
Returns 1 if the route delete request is successful, otherwise returns 0.

#define SSD_ROUTE_DELETE_REPLY_GET_ERROR_CODE cmsg   ) 
 

Value:

((cmsg->ssd_ipc_args[SSD_ROUTE_DELETE_REPLY_STATUS_ARG] == \
            SSD_SESSION_FAILED) ?  \
            (cmsg->ssd_ipc_args[SSD_ROUTE_DELETE_REPLY_ERR_CODE]) : \
            0)
Returns the error code in case of route delete failure.

Returns 0 if route delete is successful

#define SSD_ROUTE_DELETE_RPD_PROTOCOL_INVALID   12
 

The SSD server is unable to complete the route service request for this client until the route service is properly set up.

The client should retry at another time.

#define SSD_ROUTE_LOOKUP_REPLY_CHECK_STATUS cmsg   ) 
 

Value:

((cmsg->ssd_ipc_args[SSD_ROUTE_LOOKUP_REPLY_STATUS_ARG] == \
            SSD_SESSION_SUCCESS) ? 1 : 0)
Returns 1 if the route lookup request is successful, otherwise returns 0.

#define SSD_ROUTE_LOOKUP_REPLY_GET_ERROR_CODE cmsg   ) 
 

Value:

((cmsg->ssd_ipc_args[SSD_ROUTE_LOOKUP_REPLY_STATUS_ARG] == \
            SSD_SESSION_FAILED) ?  \
            (cmsg->ssd_ipc_args[SSD_ROUTE_LOOKUP_REPLY_ERR_CODE]) : \
            0)
Returns the error code for route lookup failure; if the route lookup is successful, returns 0.

#define SSD_ROUTE_LOOKUP_RPD_PROTOCOL_INVALID   12
 

The SSD server is unable to complete the route service request for this client.

The request cannot be processed until the route service is properly set up. The client should retry at another time.

#define SSD_ROUTE_SERVICE_CLEAN_UP_REPLY_CHECK_STATUS cmsg   ) 
 

Value:

((cmsg->ssd_ipc_args[SSD_ROUTE_SERVICE_CLEAN_UP_STATUS_ARG] == \
            SSD_SESSION_SUCCESS) ? 1 : 0)
Returns 1 if the route service cleanup request is successful, otherwise returns 0.

#define SSD_ROUTE_SERVICE_CLEAN_UP_RPD_PROTOCOL_INVALID   3
 

The SSD server is still not able to complete the route service request for this client, so this request cannot be processed until the route service is properly established.

In this case, the client should retry at another time

#define SSD_ROUTE_SERVICE_PENDING   5
 

The SSD server already has a route service for this client and is in the process of registering with the to register with the routing protocol daemon.

The client should wait until it receives a route service success before performing any route operation

#define SSD_ROUTE_SERVICE_REPLY_CHECK_STATUS cmsg   ) 
 

Value:

((cmsg->ssd_ipc_args[SSD_ROUTE_SERVICE_REPLY_STATUS_ARG] == \
            SSD_SESSION_SUCCESS) ? 1 : 0)
Returns 1 if the route service setup request is successful, otherwise returns 0.

#define SSD_ROUTE_SERVICE_RESET   4
 

The SSD server replies with this error code when the route service for the client is no longer valid.

This can happen either upon a registration failure with the JUNOS routing protocol daemon or upon an SSD connection loss. To recover from this error, clients should establish a new route service and add back all the routes with SSD.

#define SSD_ROUTE_TABLE_LOCATE_RPD_PROTOCOL_INVALID   7
 

The SSD server is still not able to complete the route service request for this client so this request can not be processed at this time until route service is setup properly.

In this case client has to retry some other time

#define SSD_ROUTE_TABLE_LOOKUP_REPLY_CHECK_STATUS cmsg   ) 
 

Value:

((cmsg->ssd_ipc_args[SSD_ROUTE_TABLE_LOOKUP_REPLY_STATUS_ARG] == \
            SSD_SESSION_SUCCESS) ? 1 : 0)
Returns 1 if the route table lookup request is successful, otherwise returns 0.

#define SSD_ROUTE_TABLE_LOOKUP_REPLY_GET_ERROR_CODE cmsg   ) 
 

Value:

((cmsg->ssd_ipc_args[SSD_ROUTE_TABLE_LOOKUP_REPLY_STATUS_ARG] == \
            SSD_SESSION_FAILED) ?  \
            (cmsg->ssd_ipc_args[SSD_ROUTE_TABLE_LOOKUP_REPLY_ERR_CODE]) : \
            0)
Returns the error code for route table lookup failure, if route table lookup is successful returns 0.

#define SSD_RT_LOOKUP_REPLY_GTWAY_ENTRY_MSG_LCLADDR msg   ) 
 

Value:

((u_int8_t *) (msg) + (msg)->rtgm_info_off + \
              SSD_ROUND((msg)->rtgm_gwaddrlen))

#define SSD_RT_LOOKUP_REPLY_HEAD_MSG_ROUTE msg   ) 
 

Value:

(struct ssd_rt_lookup_reply_route_entry_msg *) \
        (!(msg)->rthm_entries ? NULL : \
        ((void *) &(SSD_RT_LOOKUP_REPLY_HEAD_MSG_INFO(msg) \
                    [SSD_ROUNDUP_BIT((msg)->rthm_plen)])))

#define SSD_RT_LOOKUP_REPLY_ROUTE_ENTRY_MSG_AS msg   ) 
 

Value:

(!(msg)->rtem_n_as ? NULL : \
        ((struct ssd_rt_lookup_reply_as_msg *) \
         ((u_int8_t *)(msg) + (msg)->rtem_as_info_off)))

#define SSD_RT_LOOKUP_REPLY_ROUTE_ENTRY_MSG_AS_NEXT msg   ) 
 

Value:

((struct ssd_rt_lookup_reply_as_msg *) ((u_int8_t *)(msg) + \
        SSD_ROUND(sizeof(struct ssd_rt_lookup_reply_as_msg))));

#define SSD_RT_LOOKUP_REPLY_ROUTE_ENTRY_MSG_GTWAY_ENTRY msg   ) 
 

Value:

(!(msg)->rtem_n_gw ? NULL : \
        ((struct ssd_rt_lookup_reply_gtway_entry_msg *) (void *) \
        ((u_int8_t *)(msg) + (msg)->rtem_info_off)))

#define SSD_RT_LOOKUP_REPLY_ROUTE_ENTRY_MSG_NEXT msg   ) 
 

Value:

((struct ssd_rt_lookup_reply_route_entry_msg *) (void *) \
             ((u_int8_t *)(msg) + SSD_ROUND((msg)->rtem_len)))

#define SSD_SESSION_ID_REPLY_CHECK_STATUS cmsg   ) 
 

Value:

(((cmsg->ssd_ipc_args[SSD_SESSION_ID_REPLY_STATUS_ARG] == \
              SSD_SESSION_SUCCESS) ||                                  \
             (cmsg->ssd_ipc_args[SSD_SESSION_ID_REPLY_STATUS_ARG] == \
              SSD_SESSION_CLIENT_ID_RESTORED)) ? 1 : 0)
Returns 1 if the client ID request is successful: that is, either a new client ID for a new client or an existing client ID for a reconnecting client.

Otherwise returns 0

#define SSD_SESSION_ID_REPLY_GET_STATUS cmsg   )     (cmsg->ssd_ipc_args[SSD_SESSION_ID_REPLY_STATUS_ARG])
 

Returns the client ID status of the reply.

This can be used to check the actual reply status, both upon success and upon failure


Enumeration Type Documentation

enum ssd_sockaddr_type_
 

Enumerator:
SSD_GF_UNSPEC  SSD socket type unspecified.
SSD_GF_INET  SSD socket type inet/IPv4.
SSD_GF_MAX  Maximum number of SSD socket types.


Function Documentation

int ssd_clean_up_route_service int  fd,
unsigned int  client_ctx
 

Sends a request to the SSD server to clean up a previously set-up route service.

Parameters:
[in] fd Opened socket descriptor to the SSD server
[in] client_ctx User-supplied context that will be echoed in the callback
Returns:
The following return codes are possible:
  • -1 Error, with errno set.
  • SSD_WRITE_SUCCESS Successfully written.
  • SSD_WRITE_QUEUED_SUCCESS Successfully queued for subsequent writing.

int ssd_get_client_id int  fd,
int  client_id
 

Requests a client ID from the SSD server.

Parameters:
[in] fd Opened socket descriptor to the SSD server
[in] client_id Client ID; should be passed as 0 if this is the first request; if you are reconnecting, pass the ID that was last returned by the SSD server.
Returns:
The following return codes are possible:
  • -1 Error, with errno set.
  • SSD_WRITE_SUCCESS Successfully written.
  • SSD_WRITE_QUEUED_SUCCESS Successfully queued for subsequent writing.

int ssd_request_nexthop_add int  fd,
int  client_nexthop_id,
struct ssd_nh_add_parms parms,
unsigned int  client_ctx
 

Sends a request to the SSD server to add a nexthop.

Parameters:
[in] fd Opened socket descriptor to the SSD server
[in] client_nexthop_id Unique nexthop ID given by the client client nexthop ID Zero (0) is not allowed
[in] ifl Interface index on which to add the next hop
[in] odata Pointer to the opaque data blob passed to the next hop
[in] client_ctx User-supplied context that will be echoed in the callback
[in] pkt_dist_type Packet distribution type (flow-affinity or round-robin) for this next hop
Returns:
The following return codes are possible:
  • -1 Error, with errno set. Invalid argument is returned due to the following errors: client_nexthop_id equals zero, parms is NULL, ifl inside parms is zero, or opaque data length does not conform to the size limit
  • SSD_WRITE_SUCCESS Successfully written.
  • SSD_WRITE_QUEUED_SUCCESS Successfully queued for subsequent writing.

int ssd_request_nexthop_delete int  fd,
int  client_nexthop_id,
nh_idx_t  ssd_nh_id,
unsigned int  client_ctx
 

Sends a request to the SSD server to delete a next hop.

Parameters:
[in] fd Opened socket descriptor to the SSD server
[in] client_nexthop_id Unique nexthop ID given by the client
[in] ssd_nh_id Nexthop index passed from the SSD server
[in] client_ctx User-supplied context that will be echoed in the callback
Returns:
The following return codes are possible:
  • -1 Error, with errno set.
  • SSD_WRITE_SUCCESS Successfully written.
  • SSD_WRITE_QUEUED_SUCCESS Successfully queued for subsequent writing.

int ssd_request_route_add int  fd,
struct ssd_route_parms rtp,
unsigned int  client_ctx
 

Sends a request to the SSD server to add a route.

Parameters:
[in] fd Opened socket descriptor to the SSD server
[in] rtp A pointer to the route_params structure that describes the route
[in] client_ctx User-supplied context that will be echoed in the callback
Returns:
The following return codes are possible:
  • -1 Error, with errno set.
  • SSD_WRITE_SUCCESS Successfully written.
  • SSD_WRITE_QUEUED_SUCCESS Successfully queued for subsequent writing.

int ssd_request_route_delete int  fd,
const struct ssd_rt_delete_parms rtp,
unsigned int  client_ctx
 

Sends a request to the SSD server to delete a route.

Parameters:
[in] fd Opened socket descriptor to the SSD server
[in] rtp A pointer to the rt_delete_params structure that describes the route
[in] client_ctx User-supplied context that will be echoed in the callback
Returns:
The following return codes are possible:
  • -1 Error, with errno set.
  • SSD_WRITE_SUCCESS Successfully written.
  • SSD_WRITE_QUEUED_SUCCESS Successfully queued for subsequent writing.

int ssd_request_route_lookup int  fd,
const struct ssd_route_lookup_parms rtlp,
unsigned int  client_ctx
 

Sends a request to the SSD server to perform a route lookup.

Parameters:
[in] fd Opened socket descriptor to the SSD server
[in] rtlp A pointer to the ssd_route_lookup_parms structure which describes the route to be looked up
[in] client_ctx User-supplied context that will be echoed in the callback
Returns:
The following return codes are possible:
  • -1 Error, with errno set.
  • SSD_WRITE_SUCCESS Successfully written.
  • SSD_WRITE_QUEUED_SUCCESS Successfully queued for subsequent writing.

int ssd_request_route_table_lookup int  fd,
char *  ribname,
unsigned int  client_ctx
 

Sends a request to the SSD server to look up the routing table ID, given the routing table name.

The char *ribname argument must be allocated before it is passed to this function. libssd internally frees the memory once the request is sent succesfully.

Parameters:
[in] fd Opened socket descriptor to the SSD server
[in] ribname Pointer to the string containing the routing table name. This must point to allocated memory, which libssd will free internally
[in] client_ctx User-supplied context that will be echoed in the callback
Returns:
The following return codes are possible:
  • -1 Error, with errno set.
  • SSD_WRITE_SUCCESS Successfully written.
  • SSD_WRITE_QUEUED_SUCCESS Successfully queued for subsequent writing.

static void ssd_setsocktype ssd_sockaddr_un sun,
ssd_sockaddr_type  type
[inline, static]
 

Function to set up the socket type on a particular socket.

Parameters:
[in] sun Pointer to the socket sddress structure
[in] type The socket address type

int ssd_setup_route_service int  fd  ) 
 

Sends a request to the SSD server to set up a route service.

Parameters:
[in] fd Opened socket descriptor to the SSD server
Returns:
The following return codes are possible:
  • -1 Error, with errno set.
  • SSD_WRITE_SUCCESS Successfully written.
  • SSD_WRITE_QUEUED_SUCCESS Successfully queued for subsequent writing.


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:24:58 2010 for libssd by Doxygen 1.4.5