~clint-fewbar/ubuntu/precise/erlang/merge-15b

« back to all changes in this revision

Viewing changes to lib/diameter/include/diameter.hrl

  • Committer: Package Import Robot
  • Author(s): Sergei Golovan
  • Date: 2011-12-15 19:20:10 UTC
  • mfrom: (1.1.18) (3.5.15 sid)
  • mto: (3.5.16 sid)
  • mto: This revision was merged to the branch mainline in revision 33.
  • Revision ID: package-import@ubuntu.com-20111215192010-jnxcfe3tbrpp0big
Tags: 1:15.b-dfsg-1
* New upstream release.
* Upload to experimental because this release breaks external drivers
  API along with ABI, so several applications are to be fixed.
* Removed SSL patch because the old SSL implementation is removed from
  the upstream distribution.
* Removed never used patch which added native code to erlang beam files.
* Removed the erlang-docbuilder binary package because the docbuilder
  application was dropped by upstream.
* Documented dropping ${erlang-docbuilder:Depends} substvar in
  erlang-depends(1) manpage.
* Made erlang-base and erlang-base-hipe provide virtual package
  erlang-abi-15.b (the number means the first erlang version, which
  provides current ABI).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%
 
2
%% %CopyrightBegin%
 
3
%%
 
4
%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
 
5
%%
 
6
%% The contents of this file are subject to the Erlang Public License,
 
7
%% Version 1.1, (the "License"); you may not use this file except in
 
8
%% compliance with the License. You should have received a copy of the
 
9
%% Erlang Public License along with this software. If not, it can be
 
10
%% retrieved online at http://www.erlang.org/.
 
11
%%
 
12
%% Software distributed under the License is distributed on an "AS IS"
 
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
14
%% the License for the specific language governing rights and limitations
 
15
%% under the License.
 
16
%%
 
17
%% %CopyrightEnd%
 
18
%%
 
19
 
 
20
-ifndef(diameter_hrl).
 
21
-define(diameter_hrl, true).
 
22
 
 
23
%% RFC 3588, 2.4:
 
24
-define(DIAMETER_APP_ID_COMMON,     0).
 
25
-define(DIAMETER_APP_ID_ACCOUNTING, 3).
 
26
-define(DIAMETER_APP_ID_RELAY,      16#FFFFFFFF).
 
27
 
 
28
%% Corresponding dictionaries:
 
29
-define(DIAMETER_DICT_COMMON,       diameter_gen_base_rfc3588).
 
30
-define(DIAMETER_DICT_ACCOUNTING,   diameter_gen_base_accounting).
 
31
-define(DIAMETER_DICT_RELAY,        diameter_gen_relay).
 
32
 
 
33
%% Events sent to processes that have subscribed with
 
34
%% diameter:subscribe/1.
 
35
%%
 
36
-record(diameter_event,
 
37
        {service,   %% name
 
38
         info}).    %% tuple()
 
39
 
 
40
%% diameter_packet records are passed through the encode/decode
 
41
%% interface supplied by a dictionary module configured on a Diameter
 
42
%% application. For an incoming message the bin field contains the
 
43
%% received binary and the header, avps, msg and errors fields the
 
44
%% result of decoding.
 
45
 
 
46
-record(diameter_packet,
 
47
        {header,     %% #diameter_header{}
 
48
         avps,       %% deep list() of #diameter_avp{}
 
49
         msg,        %% fully decoded message
 
50
         bin,        %% binary received/sent over the wire
 
51
         errors = [],%% list() of Result-Code | {Result-Code, #diameter_avp{}}
 
52
         transport_data}).
 
53
 
 
54
-record(diameter_header,
 
55
        {version,            %%  8-bit unsigned
 
56
         length,             %% 24-bit unsigned
 
57
         cmd_code,           %%  8-bit unsigned
 
58
         application_id,     %% 24-bit unsigned
 
59
         hop_by_hop_id,      %% 32-bit unsigned
 
60
         end_to_end_id,      %% 32-bit unsigned
 
61
         is_request,         %% boolean() R flag
 
62
         is_proxiable,       %% boolean() P flag
 
63
         is_error,           %% boolean() E flag
 
64
         is_retransmitted}). %% boolean() T flag
 
65
 
 
66
-record(diameter_avp,
 
67
        {code,      %% 32-bit unsigned
 
68
         vendor_id, %% 32-bit unsigned
 
69
         is_mandatory    = false, %% boolean() M flag
 
70
         need_encryption = false, %% boolean() P flag
 
71
         data,      %% encoded binary()
 
72
         name,      %% atom() AVP name
 
73
         value,     %% decoded term() decoded | undefined
 
74
         type,      %% atom() type name,
 
75
         index}).   %% non_neg_integer() | undefined
 
76
 
 
77
%% A diameter_caps record corresponds to capabilities configuration on
 
78
%% diameter:start_service/2. In application callbacks is identifies
 
79
%% the peer connection for which the callback is taking place, and in
 
80
%% this case each field is a 2-tuple specifying the host (ie. local)
 
81
%% and peer (ie. remote) values, host values having been configured
 
82
%% and peer values having been received at capabilities exchange.
 
83
 
 
84
-record(diameter_caps,
 
85
        {origin_host,               %% 'DiameterIdentity'()
 
86
         origin_realm,              %% 'DiameterIdentity'()
 
87
         host_ip_address = [],      %% ['Address'()]
 
88
         vendor_id,                 %% 'Unsigned32'()
 
89
         product_name,              %% 'OctetString'()
 
90
         origin_state_id = [],      %% ['Unsigned32'()]
 
91
         supported_vendor_id = [],  %% ['Unsigned32'()]
 
92
         auth_application_id = [],  %% ['Unsigned32'()]
 
93
         inband_security_id  = [],  %% ['Unsigned32'()]
 
94
         acct_application_id = [],  %% ['Unsigned32'()]
 
95
         vendor_specific_application_id = [], %% ['Grouped'()]
 
96
         firmware_revision   = [],  %% ['Unsigned32()]
 
97
         avp = []}).
 
98
 
 
99
%% AVP's of type DiameterURI are encoded as a diameter_uri record.
 
100
%% Note that AVP's of type IPFilterRule and QoSFilterRule are currently
 
101
%% encoded simply as OctetString's.
 
102
 
 
103
-record(diameter_uri,
 
104
        {type,  %% aaa | aaas
 
105
         fqdn,  %% string()
 
106
         port = 3868, %% non_neg_integer(),
 
107
         transport = sctp,       %% | tcp,
 
108
         protocol  = diameter}). %% | radius | 'tacacs+'
 
109
 
 
110
%% A diameter_callback record can be specified as an application
 
111
%% module in order to selectively receive callbacks or alter their
 
112
%% form.
 
113
-record(diameter_callback,
 
114
        {peer_up,
 
115
         peer_down,
 
116
         pick_peer,
 
117
         prepare_request,
 
118
         prepare_retransmit,
 
119
         handle_request,
 
120
         handle_answer,
 
121
         handle_error,
 
122
         default,
 
123
         extra = []}).
 
124
 
 
125
%% The diameter service and diameter_apps records are only passed
 
126
%% through the transport interface when starting a transport process,
 
127
%% although typically a transport implementation will (and probably
 
128
%% should) only be interested host_ip_address.
 
129
 
 
130
-record(diameter_service,
 
131
        {pid,
 
132
         capabilities,        %% #diameter_caps{}
 
133
         applications = []}). %% [#diameter_app{}]
 
134
 
 
135
-record(diameter_app,
 
136
        {alias,      %% option 'alias'
 
137
         dictionary, %% option 'dictionary', module()
 
138
         module,     %% [Mod | Args] callback module() and extra args
 
139
         init_state, %% option 'state', initial callback state
 
140
         id,         %% 32-bit unsigned application identifier = Dict:id()
 
141
         mutable = false, %% boolean(), do traffic callbacks modify state?
 
142
         answer_errors = report}). %% | callback | discard
 
143
                                   %% how to handle containing errors?
 
144
 
 
145
-endif. %% -ifdef(diameter_hrl).