File: megaco_tcp.html

package info (click to toggle)
erlang-doc-html 1%3A11.b.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 23,284 kB
  • ctags: 10,724
  • sloc: erlang: 505; ansic: 323; makefile: 62; perl: 61; sh: 45
file content (274 lines) | stat: -rw-r--r-- 7,503 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.3 -->
<HTML>
<HEAD>
  <TITLE>megaco_tcp</TITLE>
  <SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
  <STYLE TYPE="text/css">
<!--
    .REFBODY     { margin-left: 13mm }
    .REFTYPES    { margin-left: 8mm }
-->
  </STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
      ALINK="#FF0000">
<!-- refpage -->
<CENTER>
<A HREF="http://www.erlang.se">
  <IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif">
</A>
<H1>megaco_tcp</H1>
</CENTER>

<H3>MODULE</H3>
<DIV CLASS=REFBODY>
megaco_tcp
</DIV>

<H3>MODULE SUMMARY</H3>
<DIV CLASS=REFBODY>
 Interface module to TPKT transport protocol for Megaco/H.248.

</DIV>

<H3>DESCRIPTION</H3>
<DIV CLASS=REFBODY>

<P> This module contains the public interface to the TPKT (TCP/IP) version
transport protocol for Megaco/H.248.

</DIV>

<H3>EXPORTS</H3>

<P><A NAME="start_transport/0"><STRONG><CODE>start_transport() -&#62; {ok, TransportRef}</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>TransportRef = pid()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>      This function is used for starting the TCP/IP transport service.
         Use exit(TransportRef, Reason) to stop the transport service.
        
</DIV>

<P><A NAME="listen/2"><STRONG><CODE>listen(TransportRef, ListenPortSpecList) -&#62; ok</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>TransportRef = pid() | regname()</CODE></STRONG><BR>
<STRONG><CODE>OptionListPerPort = [Option]</CODE></STRONG><BR>
<STRONG><CODE>Option = {port, integer()}
         |{options, list()}
         |{receive_handle, term()}</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>      This function is used for starting new TPKT listening socket
         for TCP/IP. The option list contains the socket
         definitions.
        
</DIV>

<P><A NAME="connect/2"><STRONG><CODE>connect(TransportRef, OptionList) -&#62; {ok, Handle, ControlPid} | 
        {error, Reason}</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>TransportRef = pid() | regname()</CODE></STRONG><BR>
<STRONG><CODE>OptionList = [Option]</CODE></STRONG><BR>
<STRONG><CODE>Option = {host, Ipaddr} | {port, integer()} 
         |{options, list()}
         |{receive_handle, term()}
|{module, atom()}</CODE></STRONG><BR>
<STRONG><CODE>Handle = socket_handle()</CODE></STRONG><BR>
<STRONG><CODE>ControlPid = pid()</CODE></STRONG><BR>
<STRONG><CODE>Reason = term()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>This function is used to open a TPKT connection.
<P>The <CODE>module</CODE> option makes it possible for the user to provide
         their own callback module. The <CODE>receive_message/4</CODE> or
         <CODE>process_received_message/4</CODE> functions of this module is called 
         when a new message is received (which one depends on the size of the 
         message; small - receive_message, large - process_received_message). 
         Default value is <STRONG>megaco</STRONG>.
</DIV>

<P><A NAME="close/1"><STRONG><CODE>close(Handle) -&#62; ok</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Handle = socket_handle()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>      This function is used for closing an active TPKT connection.
        
</DIV>

<P><A NAME="socket/1"><STRONG><CODE>socket(Handle) -&#62; Socket</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Handle = socket_handle()</CODE></STRONG><BR>
<STRONG><CODE>Socket = inet_socket()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>      This function is used to convert a socket_handle() to
         a inet_socket(). inet_socket() is a plain socket,
         see the inet module for more info.
        
</DIV>

<P><A NAME="send_message/2"><STRONG><CODE>send_message(Handle, Message) -&#62; ok</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Handle = socket_handle()</CODE></STRONG><BR>
<STRONG><CODE>Message = binary() | iolist()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>      Sends a message on a connection.
        
</DIV>

<P><A NAME="block/1"><STRONG><CODE>block(Handle) -&#62; ok</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Handle = socket_handle()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>      Stop receiving incomming messages on the socket.
        
</DIV>

<P><A NAME="unblock/1"><STRONG><CODE>unblock(Handle) -&#62; ok</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Handle = socket_handle()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>      Starting to receive incomming messages from the socket again.
        <A NAME="upgrade_receive_handle"><!-- Empty --></A>
</DIV>

<P><A NAME="upgrade_receive_handle/1"><STRONG><CODE>upgrade_receive_handle(ControlPid) -&#62; ok</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>ControlPid = pid()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>      Update the receive handle of the control process (e.g. after
         having changed protocol version).
        <A NAME="stats"><!-- Empty --></A>
</DIV>

<P><A NAME="get_stats/0"><STRONG><CODE>get_stats() -&#62; {ok, TotalStats} | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="get_stats/1"><STRONG><CODE>get_stats(SendHandle) -&#62; {ok, SendHandleStats} | {error, Reason}</CODE></STRONG></A><BR>
<A NAME="get_stats/2"><STRONG><CODE>get_stats(SendHandle, Counter) -&#62; {ok, CounterStats} | {error, Reason}</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>TotalStats = [send_handle_stats()]</CODE></STRONG><BR>
<STRONG><CODE>total_stats() = {send_handle(), [stats()]}</CODE></STRONG><BR>
<STRONG><CODE>SendHandle = send_handle()</CODE></STRONG><BR>
<STRONG><CODE>SendHandleStats = [stats()]</CODE></STRONG><BR>
<STRONG><CODE>Counter = tcp_stats_counter()</CODE></STRONG><BR>
<STRONG><CODE>CounterStats = integer()</CODE></STRONG><BR>
<STRONG><CODE>stats() = {tcp_stats_counter(), integer()}</CODE></STRONG><BR>
<STRONG><CODE>tcp_stats_counter() = medGwyGatewayNumInMessages | 
         medGwyGatewayNumInOctets | medGwyGatewayNumOutMessages |
         medGwyGatewayNumOutOctets | medGwyGatewayNumErrors</CODE></STRONG><BR>
<STRONG><CODE>Reason = term()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>      Retreive the TCP related (SNMP) statistics counters.
        
</DIV>

<P><A NAME="reset_stats/0"><STRONG><CODE>reset_stats() -&#62; void()</CODE></STRONG></A><BR>
<A NAME="reset_stats/1"><STRONG><CODE>reset_stats(SendHandle) -&#62; void()</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>SendHandle = send_handle()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>      Reset all TCP related (SNMP) statistics counters.
        
</DIV>

<H3>AUTHORS</H3>
<DIV CLASS=REFBODY>
Lars Thorsn - support@erlang.ericsson.se<BR>

</DIV>
<CENTER>
<HR>
<SMALL>megaco 3.5<BR>
Copyright &copy; 1991-2006
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>