⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 giop.h

📁 This directory contains source code for tcpdump, a tool for network monitoring and data acquisition
💻 H
字号:
/* $Id$
 * Copyright (c) 1997 Broadcom Eireann Research Ltd.  All Rights Reserved
 *
 * Author: Ciaran Treanor
 *
 * Purpose:
 *     IIOP (Internet Inter Orb Protocol)
 *
 * Notes:
 *
 *
 * $Log$
 * Revision 1.2  1998/06/11 20:20:22  ct
 * Added endianness support
 *
 * Revision 1.1  1998/04/29 15:43:22  ct
 * Basic GIOP support
 *
 * Revision 1.1  1997/05/24 12:19:28  ct
 * Initial revision
 *
 */


/*
 * Notes
 * enum encoded as unsigned long
 * string encoded as unsigned long (length) followed by chars (no \0 at end)
 * sequence encoded as unsigned long (length) followed by elements in seq
 *
 * Principal encoded as sequence<octet>
 * Context encoded as sequence<string>
 *     strings are in pairs, first is property name, second is value
 */
#ifndef _GIOP_H
#define _GIOP_H

#include <sys/param.h>

typedef struct OctetSequence_s {
        u_int32_t _length;
        u_char    _buffer;
      } OctetSequence;

/*
 * IOP
 */
typedef struct ServiceContext_s {
        u_int32_t      context_id;
        OctetSequence  context_data;
      } ServiceContext;

/*
 * GIOP
 */

/* GIOP Magic Number
 */
#ifdef WORDS_BIGENDIAN
  #define GIOP_MAGIC  0x47494f50 /* 'G', 'I', 'O', 'P' */
#else
  #define GIOP_MAGIC  0x504f4947
#endif

struct Version {
       u_char major;
       u_char minor;
     };

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

/* Change flags to bitfields
 */
struct MessageHeader_1_x {
       char           magic[4];
       struct Version GIOPVersion;
       u_char         flags; /* byte_order in GIOP 1.0 */
       u_char         messageType;
       u_int32_t      messageSize;
       u_char         payload;
     };

struct Sequence {
       u_int32_t numElements;
       u_char    payload;
     };

struct ServiceContext {
       u_int32_t      service_id;
       OctetSequence  context_data;
       u_char         payload;
     };

struct RequestHeader_1_0 {
       u_int32_t      request_id;
       u_char         response_expected;
       OctetSequence  object_key;
     };

struct RequestHeader_1_1 {
       u_int32_t      request_id;
       u_char         response_expected;
       u_char         reserved[3];
       OctetSequence  object_key;
     };

enum ReplyStatus {
     NoException, UserException,
     SystemException, LocationForward
   };

struct ReplyHeader {
       u_int32_t  request_id;
       u_int32_t  reply_status;
       u_char     payload;
     };

struct SystemExceptionReplyBody {
       OctetSequence  exception_id; /* Should be a String, but... */
       u_int32_t      minor_code_value;
       u_int32_t      completion_status;
     };

struct LocateRequestHeader {
       u_int32_t     request_id;
       OctetSequence object_key;
     };

enum LocateStatus {
     UnknownObject, ObjectHere, ObjectForward
   };

struct LocateReplyHeader {
       u_int32_t request_id;
       u_int32_t locate_status;
     };

extern u_int32_t gtohl            (u_int32_t val, u_char little_endian);
extern void      corba_giop_print (struct MessageHeader_1_x *header);
extern u_char   *print_object_key (int length, u_char *ptr);
extern u_char   *skip_context     (u_char *ptr);

#endif /* _GIOP_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -