Merge branch 'master' into experimental
[pkg-k5-afs_openafs.git] / src / rx / rx_conn.c
blobb75ac353ce76e4dd360b5360701f7e19c139daea
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * Copyright 2011, Your File System Inc
4 * All Rights Reserved.
6 * This software has been released under the terms of the IBM Public
7 * License. For details, see the LICENSE file in the top-level source
8 * directory or online at http://www.openafs.org/dl/license10.html
9 */
11 #include <afsconfig.h>
12 #include <afs/param.h>
14 #include <roken.h>
16 #include "rx.h"
17 #include "rx_conn.h"
19 afs_uint32
20 rx_GetConnectionEpoch(struct rx_connection *conn) {
21 return conn->epoch;
24 afs_uint32
25 rx_GetConnectionId(struct rx_connection *conn) {
26 return conn->cid;
29 void
30 rx_SetSecurityData(struct rx_connection *conn, void *data) {
31 conn->securityData = data;
34 void *
35 rx_GetSecurityData(struct rx_connection *conn)
37 return conn->securityData;
40 int
41 rx_IsUsingPktCksum(struct rx_connection *conn)
43 return conn->flags & RX_CONN_USING_PACKET_CKSUM;
46 void
47 rx_SetSecurityHeaderSize(struct rx_connection *conn, afs_uint32 size)
49 conn->securityHeaderSize = size;
52 afs_uint32
53 rx_GetSecurityHeaderSize(struct rx_connection *conn)
55 return conn->securityHeaderSize;
58 void
59 rx_SetSecurityMaxTrailerSize(struct rx_connection *conn, afs_uint32 size)
61 conn->securityMaxTrailerSize = size;
64 afs_uint32
65 rx_GetSecurityMaxTrailerSize(struct rx_connection *conn)
67 return conn->securityMaxTrailerSize;
70 void
71 rx_SetMsgsizeRetryErr(struct rx_connection *conn, int err)
73 conn->msgsizeRetryErr = err;
76 int
77 rx_IsServerConn(struct rx_connection *conn)
79 return conn->type == RX_SERVER_CONNECTION;
82 int
83 rx_IsClientConn(struct rx_connection *conn)
85 return conn->type == RX_CLIENT_CONNECTION;
88 struct rx_peer *
89 rx_PeerOf(struct rx_connection *conn)
91 return conn->peer;
94 u_short
95 rx_ServiceIdOf(struct rx_connection *conn)
97 return conn->serviceId;
101 rx_SecurityClassOf(struct rx_connection *conn)
103 return conn->securityIndex;
106 struct rx_securityClass *
107 rx_SecurityObjectOf(const struct rx_connection *conn)
109 return conn->securityObject;
112 struct rx_service *
113 rx_ServiceOf(struct rx_connection *conn)
115 return conn->service;
119 rx_ConnError(struct rx_connection *conn)
121 return conn->error;