msvcs_session.h File Reference

Functions to support session actions from plugins. More...


Data Structures

struct  msvcs_session_flow_info_s
 Flow information to be set in flow parameters. More...
struct  msvcs_session_params_s
 Parameters used for session APIs. More...

Constants used in session operations.

#define MSVCS_SESSION_OP_FLAG_FORWARD_DIR   0x1
 Session op in forward direction.
#define MSVCS_SESSION_OP_FLAG_REVERSE_DIR   0x2
 Session op in reverse direction.

Typedefs

typedef msvcs_session_s msvcs_session_t
 Forward declaration for session.
typedef msvcs_session_ext_handle_s msvcs_session_ext_handle_t
 Forward declaration for session extension handle.
typedef msvcs_session_flow_info_s msvcs_session_flow_info_t
 Flow information to be set in flow parameters.
typedef msvcs_session_params_s msvcs_session_params_t
 Parameters used for session APIs.

Enumerations

enum  msvcs_snp_flags_t {
  MSVCS_SNP_FLAGS_RSVD, MSVCS_SNP_FLAGS_FFLOW = 0x1, MSVCS_SNP_FLAGS_RFLOW = 0x2, MSVCS_SNP_FLAGS_ACQUIRE_AFFINITY = 0x4,
  MSVCS_SNP_FLAGS_OFFLOAD = 0x8, MSVCS_SNP_FLAGS_IPACTION = 0x10, MSVCS_SNP_FLAGS_FORCE_CLOSE = 0x20, MSVCS_SNP_FLAGS_CLOSE_INITIATED = 0x40,
  MSVCS_SNP_FLAGS_ENFORCE_GLOBAL_TIMEOUT = 0x80, MSVCS_SNP_FLAGS_FIRST_PKT_PENDING = 0x100, MSVCS_SNP_FLAGS_NO_DISCARD_ALG = 0x200, MSVCS_SNP_FLAGS_NO_DISCARD_TCP = 0x400,
  MSVCS_SNP_FLAGS_GATE = 0x800
}
 Sesssion parameter flags. More...
enum  msvcs_snp_ret_code_t { MSVCS_SNP_RET_CODE_EXISTING_SESSION = 0x1, MSVCS_SNP_RET_CODE_SESSION_LIMIT = 0x2 }

Functions

int msvcs_session_ignore (msvcs_session_t *session, int plugin_id, msvcs_session_op_flags_t flags)
 Request packet events to be ignored for a plugin on the session.
msvcs_session_tmsvcs_session_open (msvcs_session_params_t *params)
int msvcs_session_close (msvcs_session_t *session)
int msvcs_session_timed_close (msvcs_session_t *session, int timeout)
 Close a session after the specified time interval.
int msvcs_session_drop (msvcs_session_t *session, msvcs_session_op_flags_t flags)
 Drop all the packets for this session.
int msvcs_session_set_ext_handle (msvcs_session_t *session, u_int8_t pid, void *fh, void *rh)
 Set the forward/reverse extension handles for a session.
int msvcs_session_get_ext_handle (msvcs_session_t *session, u_int8_t pid, void **fh, void **rh)
 Get the forward/reverse extension handles for a session.
msvcs_session_tmsvcs_session_getnext (const index32_t *prev_index, index32_t *ret_index)
 API to sweep the session table.
void msvcs_session_cos_dscp_set (msvcs_session_t *session, u_int8_t dscp, int pid)


Detailed Description

Functions to support session actions from plugins.

This file provides the necessary functions that let plugins operate on sessions. The following things are supported:


Typedef Documentation

typedef struct msvcs_session_ext_handle_s msvcs_session_ext_handle_t
 

Forward declaration for session extension handle.

A session extension handle is a block of memory allocated by plugins and is attached to a session to track plugin specific state.


Enumeration Type Documentation

enum msvcs_snp_flags_t
 

Sesssion parameter flags.

These flags are used to support the following actions:

  • FFLOW: create forward flow on the session. (params in snp_fflow).
  • RFLOW: create reverse flow on the session. (params in snp_rflow).
  • ACQUIRE_AFFINITY: This can be used during the session_open time to request session affinity.
Enumerator:
MSVCS_SNP_FLAGS_RSVD  Internal use.
MSVCS_SNP_FLAGS_FFLOW  Forward flow.
MSVCS_SNP_FLAGS_RFLOW  Reverse flow.
MSVCS_SNP_FLAGS_ACQUIRE_AFFINITY  Request session affinity, internal use.
MSVCS_SNP_FLAGS_OFFLOAD  Session offload status, internal use.
MSVCS_SNP_FLAGS_IPACTION  IP action session.
MSVCS_SNP_FLAGS_FORCE_CLOSE  For session close, internal use.
MSVCS_SNP_FLAGS_CLOSE_INITIATED  close initiated, internal use.
MSVCS_SNP_FLAGS_ENFORCE_GLOBAL_TIMEOUT  service-options enforce-global-timeout

enum msvcs_snp_ret_code_t
 

Enumerator:
MSVCS_SNP_RET_CODE_EXISTING_SESSION  Found Existing Session.
MSVCS_SNP_RET_CODE_SESSION_LIMIT  Session/flow limit reached.


Function Documentation

int msvcs_session_drop msvcs_session_t session,
msvcs_session_op_flags_t  flags
 

Drop all the packets for this session.

Parameters:
[in] session Session to be dropped
[in] flags Direction the action should be performed on.
Returns:
Returns 0 on success; -1 on failure

int msvcs_session_get_ext_handle msvcs_session_t session,
u_int8_t  pid,
void **  fh,
void **  rh
 

Get the forward/reverse extension handles for a session.

Parameters:
[in] session Session to be operated on.
[in] pid ID of the plugin requesting the operation.
[out] fh Forward flow extension handle if present.
[out] rh Reverse flow extension handle if present.
Returns:
Returns 0 on success; -1 on failure

msvcs_session_t* msvcs_session_getnext const index32_t *  prev_index,
index32_t *  ret_index
 

API to sweep the session table.

Parameters:
[in] prev_index Reference index to retrieve the next session.
[in] ret_index Current session index returned by API, to be used as the next session id.
Returns:
Next session on success; NULL when the session walk is done or if the session table is empty.

int msvcs_session_ignore msvcs_session_t session,
int  plugin_id,
msvcs_session_op_flags_t  flags
 

Request packet events to be ignored for a plugin on the session.

This function is called by plugins to not receive any further packet events on a session. Session events are still delivered to the plugins.

Parameters:
[in] session Session.
[in] plugin_id ID of the plugin requesting the action.
[in] flags Direction the action should be performed on.
Returns:
0 on success; otherwise EINVAL

int msvcs_session_set_ext_handle msvcs_session_t session,
u_int8_t  pid,
void *  fh,
void *  rh
 

Set the forward/reverse extension handles for a session.

Parameters:
[in] session Session to be operated on.
[in] pid ID of the plugin requesting the operation.
[in] fh Forward flow extension handle.
[in] rh Reverse flow extension handle.
Returns:
Returns 0 on success; -1 on failure

int msvcs_session_timed_close msvcs_session_t session,
int  timeout
 

Close a session after the specified time interval.

Parameters:
[in] session Session to be closed.
[in] timeout Timeout value in milli seconds.
Returns:
Returns 0 on success; on failure returns one of the error codes below. EIO ENOMEM


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:53 2010 for libmsp-svcs by Doxygen 1.4.5