| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# $Id: GIOP.pm,v 1.1.1.1 1997/05/17 11:47:05 schuller Exp $ |
|
2
|
|
|
|
|
|
|
# Copyright (c) 1997 Lunatech Research / Bart Schuller |
|
3
|
|
|
|
|
|
|
# See the file "Artistic" in the distribution for licensing and |
|
4
|
|
|
|
|
|
|
# (lack of) warranties. |
|
5
|
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
14
|
use COPE::CORBA::ORB; |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
3345
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# module GIOP |
|
9
|
|
|
|
|
|
|
package GIOP; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# enum MsgType |
|
12
|
0
|
|
|
0
|
|
|
sub Request { 0 } |
|
13
|
0
|
|
|
0
|
|
|
sub Reply { 1 } |
|
14
|
0
|
|
|
0
|
|
|
sub CancelRequest { 2 } |
|
15
|
0
|
|
|
0
|
|
|
sub LocateRequest { 3 } |
|
16
|
0
|
|
|
0
|
|
|
sub LocateReply { 4 } |
|
17
|
0
|
|
|
0
|
|
|
sub CloseConnection { 5 } |
|
18
|
0
|
|
|
0
|
|
|
sub MessageError { 6 } |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# struct Version |
|
21
|
|
|
|
|
|
|
package GIOP::Version; |
|
22
|
|
|
|
|
|
|
@ISA=qw(CORBA::_Struct); |
|
23
|
|
|
|
|
|
|
sub _marshal { |
|
24
|
0
|
|
|
0
|
|
|
my($self) = pop; # sic |
|
25
|
0
|
|
|
|
|
|
CORBA::ORB::_marshal_char(@_, $self->{major}); |
|
26
|
0
|
|
|
|
|
|
CORBA::ORB::_marshal_char(@_, $self->{minor}); |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub _unmarshal { |
|
30
|
0
|
|
|
0
|
|
|
my $self = {}; |
|
31
|
0
|
|
|
|
|
|
$self->{major} = CORBA::ORB::_unmarshal_char(@_); |
|
32
|
0
|
|
|
|
|
|
$self->{minor} = CORBA::ORB::_unmarshal_char(@_); |
|
33
|
0
|
|
|
|
|
|
return bless $self, 'GIOP::Version'; |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#$_tc = _create_struct_tc('', 'Version', |
|
37
|
|
|
|
|
|
|
# major => $CORBA::_tc_char, |
|
38
|
|
|
|
|
|
|
# minor => $CORBA::_tc_char, |
|
39
|
|
|
|
|
|
|
#); |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# struct MessageHeader |
|
42
|
|
|
|
|
|
|
package GIOP::MessageHeader; |
|
43
|
|
|
|
|
|
|
@ISA=qw(CORBA::_Struct); |
|
44
|
|
|
|
|
|
|
# string, index, byte_order, self |
|
45
|
|
|
|
|
|
|
sub _marshal { |
|
46
|
0
|
|
|
0
|
|
|
my($self) = pop; # sic |
|
47
|
0
|
|
|
|
|
|
CORBA::ORB::_marshal_char_array(@_, $self->{magic}, 4); |
|
48
|
0
|
|
|
|
|
|
GIOP::Version::_marshal(@_, $self->{GIOP_version}); |
|
49
|
0
|
|
|
|
|
|
CORBA::ORB::_marshal_boolean(@_, $self->{byte_order}); |
|
50
|
0
|
|
|
|
|
|
CORBA::ORB::_marshal_octet(@_, $self->{message_type}); |
|
51
|
0
|
|
|
|
|
|
CORBA::ORB::_marshal_ulong(@_, $self->{message_size}); |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub _unmarshal { |
|
55
|
0
|
|
|
0
|
|
|
my($byte_order_ref) = pop; |
|
56
|
0
|
|
|
|
|
|
my $self = {}; |
|
57
|
0
|
|
|
|
|
|
$self->{magic} = CORBA::ORB::_unmarshal_char_array(@_, $$byte_order_ref, 4); |
|
58
|
0
|
|
|
|
|
|
$self->{GIOP_version} = GIOP::Version::_unmarshal(@_, $$byte_order_ref); |
|
59
|
0
|
|
|
|
|
|
$self->{byte_order} = CORBA::ORB::_unmarshal_boolean(@_, $$byte_order_ref); |
|
60
|
0
|
|
|
|
|
|
$$byte_order_ref = $self->{byte_order}; |
|
61
|
0
|
|
|
|
|
|
$self->{message_type} = CORBA::ORB::_unmarshal_octet(@_, $$byte_order_ref); |
|
62
|
0
|
|
|
|
|
|
$self->{message_size} = CORBA::ORB::_unmarshal_ulong(@_, $$byte_order_ref); |
|
63
|
0
|
|
|
|
|
|
return bless $self, 'GIOP::MessageHeader'; |
|
64
|
|
|
|
|
|
|
} |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
#$_tc = _create_struct_tc('', 'MessageHeader', |
|
67
|
|
|
|
|
|
|
# magic => create_array_tc(4, $CORBA::_tc_char), |
|
68
|
|
|
|
|
|
|
# GIOP_version => $GIOP::Version::_tc, |
|
69
|
|
|
|
|
|
|
# byte_order => $CORBA::_tc_boolean, |
|
70
|
|
|
|
|
|
|
# message_type => $CORBA::_tc_octet, |
|
71
|
|
|
|
|
|
|
# message_size => $CORBA::_tc_ulong, |
|
72
|
|
|
|
|
|
|
#); |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# struct RequestHeader |
|
75
|
|
|
|
|
|
|
package GIOP::RequestHeader; |
|
76
|
|
|
|
|
|
|
@ISA=qw(CORBA::_Struct); |
|
77
|
|
|
|
|
|
|
sub _marshal { |
|
78
|
0
|
|
|
0
|
|
|
my($self) = pop; # sic |
|
79
|
0
|
|
|
|
|
|
CORBA::ORB::_marshal_sequence(@_, $self->{service_context}, \&IOP::ServiceContext::_marshal); |
|
80
|
0
|
|
|
|
|
|
CORBA::ORB::_marshal_ulong(@_, $self->{request_id}); |
|
81
|
0
|
|
|
|
|
|
CORBA::ORB::_marshal_boolean(@_, $self->{response_expected}); |
|
82
|
0
|
|
|
|
|
|
CORBA::ORB::_marshal_octet_sequence(@_, $self->{object_key}); |
|
83
|
0
|
|
|
|
|
|
CORBA::ORB::_marshal_string(@_, $self->{operation}); |
|
84
|
0
|
|
|
|
|
|
CORBA::ORB::_marshal_octet_sequence(@_, $self->{requesting_principal}); |
|
85
|
|
|
|
|
|
|
} |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub _unmarshal { |
|
88
|
0
|
|
|
0
|
|
|
my $self = {}; |
|
89
|
0
|
|
|
|
|
|
$self->{service_context} = CORBA::ORB::_unmarshal_sequence(@_, \&IOP::ServiceContext::_unmarshal); |
|
90
|
0
|
|
|
|
|
|
$self->{request_id} = CORBA::ORB::_unmarshal_ulong(@_); |
|
91
|
0
|
|
|
|
|
|
$self->{response_expected} = CORBA::ORB::_unmarshal_boolean(@_); |
|
92
|
0
|
|
|
|
|
|
$self->{object_key} = CORBA::ORB::_unmarshal_octet_sequence(@_); |
|
93
|
0
|
|
|
|
|
|
$self->{operation} = CORBA::ORB::_unmarshal_string(@_); |
|
94
|
0
|
|
|
|
|
|
$self->{requesting_principal} = CORBA::ORB::_unmarshal_octet_sequence(@_); |
|
95
|
0
|
|
|
|
|
|
return bless $self, 'GIOP::RequestHeader'; |
|
96
|
|
|
|
|
|
|
} |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
#$_tc = _create_struct_tc('', 'RequestHeader', |
|
99
|
|
|
|
|
|
|
# service_context => $IOP::ServiceContextList::_tc, |
|
100
|
|
|
|
|
|
|
# request_id => $CORBA::_tc_ulong, |
|
101
|
|
|
|
|
|
|
# response_expected => $CORBA::_tc_boolean, |
|
102
|
|
|
|
|
|
|
# object_key => create_sequence_tc(0,$CORBA::_tc_octet), |
|
103
|
|
|
|
|
|
|
# operation => create_string_tc(0), |
|
104
|
|
|
|
|
|
|
# requesting_principal => $CORBA::_tc_Principal, |
|
105
|
|
|
|
|
|
|
#); |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
package GIOP; |
|
108
|
|
|
|
|
|
|
# enum ReplyStatusType |
|
109
|
|
|
|
|
|
|
sub NO_EXCEPTION () { 0 } |
|
110
|
|
|
|
|
|
|
sub USER_EXCEPTION () { 1 } |
|
111
|
|
|
|
|
|
|
sub SYSTEM_EXCEPTION () { 2 } |
|
112
|
|
|
|
|
|
|
sub LOCATION_FORWARD () { 3 } |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
# struct ReplyHeader |
|
115
|
|
|
|
|
|
|
package GIOP::ReplyHeader; |
|
116
|
|
|
|
|
|
|
@ISA=qw(CORBA::_Struct); |
|
117
|
|
|
|
|
|
|
sub _unmarshal { |
|
118
|
0
|
|
|
0
|
|
|
my $self = {}; |
|
119
|
0
|
|
|
|
|
|
$self->{service_context} = CORBA::ORB::_unmarshal_sequence( |
|
120
|
|
|
|
|
|
|
@_, \&IOP::ServiceContext::_unmarshal); |
|
121
|
0
|
|
|
|
|
|
$self->{request_id} = CORBA::ORB::_unmarshal_ulong(@_); |
|
122
|
0
|
|
|
|
|
|
$self->{reply_status} = CORBA::ORB::_unmarshal_enum(@_); |
|
123
|
0
|
|
|
|
|
|
return bless $self, 'GIOP::ReplyHeader'; |
|
124
|
|
|
|
|
|
|
} |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
sub _marshal { |
|
127
|
0
|
|
|
0
|
|
|
my($self) = pop; # sic |
|
128
|
0
|
|
|
|
|
|
CORBA::ORB::_marshal_sequence(@_, $self->{service_context}, \&IOP::ServiceContext::_marshal); |
|
129
|
0
|
|
|
|
|
|
CORBA::ORB::_marshal_ulong(@_, $self->{request_id}); |
|
130
|
0
|
|
|
|
|
|
CORBA::ORB::_marshal_enum(@_, $self->{reply_status}); |
|
131
|
|
|
|
|
|
|
} |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
1; |