Add route table guide and formatting tweaks
[ric-plt/lib/rmr.git] / doc / src / man / rmr_rts_msg.3.xfm
1 .if false
2 ==================================================================================
3    Copyright (c) 2019-2020 Nokia
4    Copyright (c) 2018-2020 AT&T Intellectual Property.
5
6    Licensed under the Apache License, Version 2.0 (the "License");
7    you may not use this file except in compliance with the License.
8    You may obtain a copy of the License at
9
10        http://www.apache.org/licenses/LICENSE-2.0
11
12    Unless required by applicable law or agreed to in writing, software
13    distributed under the License is distributed on an "AS IS" BASIS,
14    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15    See the License for the specific language governing permissions and
16    limitations under the License.
17 ==================================================================================
18 .fi
19 .if false
20     Mnemonic    rmr_rts_msg_man.xfm
21     Abstract    The manual page for the rmr_rts_msg function.
22     Author      E. Scott Daniels
23     Date        28 January 2019
24 .fi
25
26 .gv e LIB lib
27 .im &{lib}/man/setup.im
28
29 &line_len(6i)
30
31 &h1(RMR Library Functions)
32 &h2(NAME)
33     rmr_rts_msg
34
35 &h2(SYNOPSIS )
36 &indent
37 &ex_start
38 #include <rmr/rmr.h>
39
40 rmr_mbuf_t*  rmr_rts_msg( void* vctx, rmr_mbuf_t* msg );
41 &ex_end
42 &uindent
43
44 &h2(DESCRIPTION)
45 The &cw(rmr_rts_msg) function sends a message returning it to the endpoint
46 which sent the message rather than selecting an endpoint based on the
47 message type and routing table.
48 Other than this small difference, the behaviour is exactly the same as
49 &cw(rmr_send_msg.)
50
51 .** pull in common retry text
52 .im &{lib}/man/retry.im
53
54 &h2(PAYLOAD SIZE)
55 When crafting a response based on a received message, the user application must
56 take care not to write more bytes to the message payload than the allocated message
57 has.
58 In the case of a received message, it is possible that the response needs to be
59 larger than the payload associated with the inbound message.
60 In order to use the return to sender function, the source information in the original
61 message must be present in the response; information which cannot be added to a
62 message buffer allocated through the standard RMR allocation function.
63 To allocate a buffer with a larger payload, and which retains the necessary sender
64 data needed by this function, the &ital(rmr_realloc_payload()) function must be
65 used to extend the payload to a size suitable for the response.
66
67 &h2(RETURN VALUE)
68 On success, a new message buffer, with an empty payload, is returned for the application
69 to use for the next send.
70 The state in this buffer will reflect the overall send operation state and should be
71 &cw(RMR_OK.)
72
73 &space
74 If the state in the returned buffer is anything other than &cw(RMR_OK,) the user application
75 may need to attempt a retransmission of the message, or take other action depending on the
76 setting of &cw(errno) as described below.
77
78 &space
79 In the event of extreme failure, a nil pointer is returned. In this case the value of
80 &cw(errno) might be of some use, for documentation, but there will be little that the
81 user application can do other than to move on.
82
83 &h2(ERRORS)
84 The following values may be passed back in the &ital(state) field of the returned message
85 buffer.
86
87 &space
88 &beg_dlist(.75i : ^&bold_font )
89 &ditem(RMR_ERR_BADARG) The message buffer pointer did not refer to a valid message.
90 &ditem(RMR_ERR_NOHDR)  The header in the message buffer was not valid or corrupted.
91 &ditem(RMR_ERR_NOENDPT)  The message type in the message buffer did not map to a known endpoint.
92 &ditem(RMR_ERR_SENDFAILED)  The send failed; &cw(errno) has the possible reason.
93 &end_dlist
94
95 &space
96 The following values may be assigned to &cw(errno) on failure.
97
98 &beg_dlist(.75i : ^&bold_font )
99 &ditem(INVAL) Parameter(s) passed to the function were not valid, or the underlying message processing environment was unable to interpret the message.
100
101 &ditem(ENOKEY) The header information in the message buffer was invalid.
102
103 &ditem(ENXIO) No known endpoint for the message could be found.
104
105 &ditem(EMSGSIZE) The underlying transport refused to accept the message because of a size value issue (message was not attempted to be sent).
106
107 &ditem(EFAULT) The message referenced by the message buffer is corrupt (nil pointer or bad internal length).
108
109 &ditem(EBADF) Internal RMR error; information provided to the message transport environment was not valid.
110
111 &ditem(ENOTSUP) Sending was not supported by the underlying message transport.
112
113 &ditem(EFSM) The device is not in a state that can accept the message.
114
115 &ditem(EAGAIN) The device is not able to accept a message for sending. The user application should attempt to resend.
116
117 &ditem(EINTR) The operation was interrupted by delivery of a signal before the message was sent.
118
119 &ditem(ETIMEDOUT) The underlying message environment timed out during the send process.
120
121 &ditem(ETERM) The underlying message environment is in a shutdown state.
122 &end_dlist
123
124 &h2(EXAMPLE)
125
126 &h2(SEE ALSO )
127 .ju off
128 rmr_alloc_msg(3),
129 rmr_call(3),
130 rmr_free_msg(3),
131 rmr_init(3),
132 rmr_payload_size(3),
133 rmr_send_msg(3),
134 rmr_rcv_msg(3),
135 rmr_rcv_specific(3),
136 rmr_ready(3),
137 rmr_fib(3),
138 rmr_has_str(3),
139 rmr_set_stimeout(3),
140 rmr_tokenise(3),
141 rmr_mk_ring(3),
142 rmr_ring_free(3)
143 .ju on
144