2 ==================================================================================
3 Copyright (c) 2019 Nokia
4 Copyright (c) 2018-2019 AT&T Intellectual Property.
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
10 http://www.apache.org/licenses/LICENSE-2.0
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 ==================================================================================
21 Mnemonic rmr_get_srcip.xfm
22 Abstract The manual page for the rmr_get_srcip function.
23 Author E. Scott Daniels
28 .im &{lib}/man/setup.im
32 &h1(RMR Library Functions)
41 unsigned char* rmr_get_srcip( rmr_mbuf_t* mbuf, unsigned char* dest )
47 The &cw(rmr_get_srcip) function will copy the &ital(source IP address) from the message to a buffer
48 (dest) supplied by the user.
49 In an RMr message, the source IP address is the sender's information that is used for return to sender
50 function calls; this function makes it available to the user application.
51 The address is maintained as IP:port where &ital(IP) could be either an IPv6 or IPv4 address depending
52 on what was provided by the sending application.
55 The maximum size allowed by RMr is 64 bytes (including the nil string terminator), so the user
56 must ensure that the destination buffer given is at least 64 bytes. The user application should use
57 the RMr constant RMR_MAX_SRC to ensure that the buffer supplied is large enough, and to protect
58 against future RMr enhancements which might increase the address buffer size requirement.
61 On success, a pointer to the destination buffer is given as a convenience to the user programme.
62 On failure, a nil pointer is returned and the value of errno is set.
65 If an error occurs, the value of the global variable &cw(errno) will be set to one of
66 the following with the indicated meaning.
68 &beg_dlist(.75i : ^&bold_font )
70 &di(EINVAL) The message, or an internal portion of the message, was corrupted or the pointer was invalid.