/*****************************************************************************

 @(#) sctpi.h,v 0.7 2000/11/25 07:23:17 brian Stab

 -----------------------------------------------------------------------------

     Copyright (C) 2000  Brian Bidulock.  All Rights Reserved.


                                  PUBLIC LICENSE

     This license is provided without fee, provided that the above copy-
     right notice and this public license must be retained on all copies,
     extracts, compilations and derivative works.  Use or distribution of
     this work in a manner that restricts its use except as provided here
     will render this license void.

     The author(s) hereby waive any and all other restrictions in respect
     of their copyright in this software and its associated documentation.
     The authors(s) of this software place in the public domain any novel
     methods or processes which are embodied in this software.

     The author(s) undertook to write it for the sake of the advancement
     of the Arts and Sciences, but it is provided as is, and the author(s)
     will not take any responsibility in it.

 -----------------------------------------------------------------------------

 Last Modified 2000/11/25 07:23:17 by brian

 sctpi.h,v
 Revision 0.7  2000/11/25 07:23:17  brian
 Stab at a STREAMS interface for SCTP.

 *****************************************************************************/

#ifndef __SCTPI_H__
#define __SCTPI_H__

/*
 *  This is a STREAMS-based definition of the SCTP (Stream Control
 *  Transmission Protocol) RFC 2960.  It is based as closely as possible on
 *  the UNIX International, Inc. TLI (Transport Layer Interface) and the XTI
 *  (X/Open Transport Interface).  This interface was developed for the
 *  OpenSS7 package and implementation of the SIGTRAN protocols M2PA, M2UA,
 *  M3UA and SUA.
 */

#define ST_CONN_REQ     0   /* ASSOCIATE */
#define ST_CONN_RES     1   /* ASSOCIATE */
#define ST_DISCON_REQ   2   /* ABORT */
#define ST_DATA_REQ     3   /* SEND */
#define ST_EXDATA_REQ   4   /* SEND */
#define ST_INFO_REQ     5   /* STATUS */
#define ST_BIND_REQ     6   /* INITIALIZE */
#define ST_UNBIND_REQ   7   /* DESTROY */
#define ST_UNITDATA_REQ 8   /* SEND */
#define ST_OPTMGMT_REQ  9   /* SETPRIMARY */
#define ST_ORDREL_REQ   10  /* SHUTDOWN */

#define ST_CONN_IND     11  /* incoming association */
#define ST_CONN_CON     12  /* ASSOCIATE result */
#define ST_DISCON_IND   13  /* received ABORT */
#define ST_DATA_IND     14  /* RECEIVE */
#define ST_EXDATA_IND   15  /* RECEIVE */
#define ST_INFO_ACK     16  /* STATUS result */
#define ST_BIND_ACK     17  /* INITIALIZE result */
#define ST_ERROR_ACK    18  /* any error result */
#define ST_OK_ACK       19  /* any ok result */
#define ST_UNITDATA_IND 20  /* RECEIVE */
#define ST_UDERROR_IND  21  /* RECEIVE */
#define ST_OPTMGMT_ACK  22  /* SETPRIMARY result */
#define ST_ORDREL_IND   23  /* recevied SHUTDOWN */

typedef struct {
    st_ulong    st_primitive;   /* ST_CONN_REQ */
    st_ulong    st_dest_length; /* assoc id and destination transport address length */
    st_ulong    st_dest_offset; /* offset in this message */
    st_ulong    st_opt_length;  /* options includes number of streams */
    st_ulong    st_opt_offset;  /* offset in this messsage */
} st_conn_req_t;

typedef struct {

/*****************************************************/
/*****************************************************/
/*****************************************************/
/*****************************************************/
/*****************************************************/
/*****************************************************/

#define ST_INITIALIZE_REQ   0
#define ST_INITIALIZE_CON   1
#define ST_ASSOCIATE_REQ    2
#define ST_ASSOCIATE_CON    3
#define ST_SHUTDOWN_REQ     5
#define ST_SHUTDOWN_CON     6
#define ST_ERROR_ACK        8

typedef struct {
    st_ulong    st_primitive;   /* ST_INITIALIZE_REQ */
    st_ushort   st_port;
    st_ushort   st_num_addr;
} st_initialize_req_t;
/* followed by list of addresses */

typedef struct {
    st_ulong    st_primitive;   /* ST_INITIALIZE_CON */
    st_ulong    st_state;       /* state of the interface */
    st_ulong    st_instance_id; /* instance id */
} st_initialize_con_t;

typedef struct {
    st_ulong    st_primitive;   /* ST_ASSOCIATE_REQ */
    st_ulong    st_instance_id; /* instance identifier */
    st_dtaddr   st_dta;         /* destination transport address */
    st_ulong    st_streams;     /* number of streams */
} st_associate_req_t;

typedef struct {
    st_ulong    st_primitive;   /* ST_ASSOCIATE_CON */
    st_ulong    st_state;       /* state of the interface */
    st_ulong    st_assoc_id;    /* association identifier */
    st_ulong    st_num_dtas;    /* number of destination transport addrs */
} st_associate_con_t;
/* followed by list of destination transport addresses */

typedef struct {
    st_ulong    st_primitive;   /* ST_SHUTDOWN_REQ */
    st_ulong    st_assoc_id;    /* association identifier */
} st_shutdown_req_t;

typedef struct {
    st_ulong    st_primitive;   /* ST_SHUTDOWN_REQ */
    st_ulong    st_state;       /* state of the interface */
} st_shutdown_con_t;

typedef struct {
    st_ulong    st_primitive;   /* ST_SHUTDOWN_REQ */
    st_ulong    st_state;       /* state of the interface */
} st_shutdown_err_t;

typedef struct {
    st_ulong    st_primitive;   /* ST_ERR_ACK */
    st_ulong    st_state;       /* state of the interface */
    st_ulong    st_error;       /* error code */
} st_err_ack_t;



#endif  __SCTPI_H__
