// **********************************************************************
//
// Copyright (c) 1999
// Object Oriented Concepts, Inc.
// Billerica, MA, USA
//
// All Rights Reserved
//
// **********************************************************************

#ifndef GIOP_IDL
#define GIOP_IDL

#include <IOP.idl>

#pragma prefix "omg.org"

module GIOP
{

struct Version
{ 
    octet major;
    octet minor;
};

enum MsgType
{
    Request,
    Reply,
    CancelRequest,
    LocateRequest,
    LocateReply,
    CloseConnection,
    MessageError
};

struct MessageHeader
{
    char magic[4];
    Version version;
    octet flag;
    octet message_type;
    unsigned long message_size;
}; 

struct RequestHeader
{
    IOP::ServiceContextList service_context;
    unsigned long request_id;
    boolean response_expected;
    octet reserved[3];
    sequence<octet> object_key;
    string operation;
    CORBA::Principal requesting_principal;
};

enum ReplyStatusType
{
    NO_EXCEPTION,
    USER_EXCEPTION,
    SYSTEM_EXCEPTION,
    LOCATION_FORWARD
};

struct ReplyHeader
{
    IOP::ServiceContextList service_context;
    unsigned long request_id;
    ReplyStatusType reply_status;
};

struct CancelRequestHeader
{
    unsigned long request_id;
};

struct LocateRequestHeader
{
    unsigned long request_id;
    sequence<octet> object_key;
};

enum LocateStatusType
{
    UNKNOWN_OBJECT,
    OBJECT_HERE,
    OBJECT_FORWARD
};

struct LocateReplyHeader
{
    unsigned long request_id;
    LocateStatusType locate_status;
};

}; // End module GIOP

#endif
