comparison src/g23m-fad/tcpip/rnet/rnet_rt/rnet_rt_api_getmaxpacketsize.c @ 1:d393cd9bb723

src/g23m-*: initial import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jul 2018 04:40:46 +0000
parents
children
comparison
equal deleted inserted replaced
0:b6a5e36de839 1:d393cd9bb723
1 /**
2 * @file rnet_rt_api_getmaxpacketsize.c
3 *
4 * RNET_RT API
5 *
6 * @author Regis Feneon
7 * @version 0.1
8 */
9
10 /*
11 * $Id: rnet_rt_api_getmaxpacketsize.c,v 1.3 2002/10/30 15:23:34 rf Exp $
12 * $Name: ti_20021030 $
13 *
14 * History:
15 *
16 * Date Author Modification
17 * --------------------------------------------------
18 * 7/23/2002 Regis Feneon Create
19 *
20 */
21 #include "rnet_cfg.h"
22 #ifdef RNET_CFG_REAL_TRANSPORT
23
24 #include "rnet_rt_i.h"
25 #include "rnet_rt_env.h"
26
27 /**
28 * Gets the maximum send size of a message.
29 *
30 * @param desc Connection identifier [IN].
31 * @param size_p Maximum send size [OUT].
32 * @return RNET_NOT_INITIALIZED NET subsystem not initialized (internal error).
33 * RNET_INTERNAL_ERR Network subsystem failed.
34 * RNET_INVALID_PARAMETER The connection ID is invalid.
35 * RNET_NOT_READY Still processing a callback function.
36 * RNET_OK Local address/port successfully get.
37 */
38
39 T_RNET_RET rnet_rt_get_max_packet_size(T_RNET_DESC * desc,
40 UINT32 * size_p)
41 {
42 int err, len, maxsize;
43
44 len = sizeof( maxsize);
45
46 /* get socket buffer size */
47 rvf_lock_mutex( &rnet_rt_env_ctrl_blk_p->mutex);
48 err = ngSAIOGetOption( (NGsock *) desc, NG_IOCTL_SOCKET, NG_SO_SNDBUF,
49 &maxsize, &len);
50 rvf_unlock_mutex( &rnet_rt_env_ctrl_blk_p->mutex);
51
52 if( err == NG_EOK) {
53 *size_p = maxsize;
54 return( RNET_OK);
55 }
56
57 return( rnet_rt_ngip_error( err));
58 }
59
60 #endif /* ifdef RNET_CFG_REAL_TRANSPORT */
61