session.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* Copyright 1996 Sun Microsystems, Inc. All Rights Reserved.
* Use is subject to license terms.
*/
/*
* HISTORY
* 5-28-96 Jerry Yeung Three phase set protocol(ThreePhase)
*/
#ifndef _SESSION_H_
#define _SESSION_H_
#pragma ident "%Z%%M% %I% %E% SMI"
/***** GLOBAL CONSTANTS *****/
/* states of a request */
#define REQUEST_STARTED 1
#define REQUEST_COMPLETED 2
/***** GLOBAL TYPES *****/
typedef struct _Agent_List {
struct _Agent_List *next;
} Agent_List;
typedef struct _Request {
struct _Request *next_request;
int state; /* STARTED or COMPLETED */
} Request;
typedef struct _Session {
struct _Session *next_session;
int n_variables; /* number of variables in the */
/* "original" SNMP request */
} Session;
/* Three Phase */
typedef struct _Three_Phase {
} Three_Phase;
/* explanation for the flags: */
/* -------------------------- */
/* */
/* Each bit in a flags corresponds to a variable */
/* in the "original" SNMP request. */
/* For example, the o_flag 0x7 in the Session means */
/* that the "original" SNMP request contains 3 */
/* variables, the flags 0x5 of the Request 0 means that */
/* this Request handles the 1st and the 3rd */
/* variable of the "original" SNMP request, the flags */
/* 0x2 of the Request 1 means that this Request */
/* handles the 2nd variable of the "original" SNMP */
/* request. When a Request is completed, its flags */
/* are ORed with the i_flags of its Session, so as soon */
/* as o_flags == i_flags, we known that all the Requests*/
/* are completed and we start to compute the response */
/* of the "original" SNMP request. */
/***** GLOBAL FUNCTIONS *****/
extern void trace_sessions();
/* session_list_delete() will delete the whole session list */
extern void session_list_delete();
extern void session_dispatch();
extern void session_read();
extern void session_timeout();
extern int any_outstanding_session();
#endif