rx: Don't adjust non-existent events
[openafs.git] / src / rx / rx_conn.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * Copyright 2011, Your File System Inc
4  * All Rights Reserved.
5  *
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  */
10
11 #include <afsconfig.h>
12 #include <afs/param.h>
13
14 #include <roken.h>
15
16 #include "rx.h"
17 #include "rx_conn.h"
18
19 void
20 rx_SetConnectionEpoch(struct rx_connection *conn, afs_int32 epoch) {
21     conn->epoch = epoch;
22 }
23
24 int
25 rx_GetConnectionEpoch(struct rx_connection *conn) {
26     return conn->epoch;
27 }
28
29 void
30 rx_SetConnectionId(struct rx_connection *conn, int cid) {
31     conn->cid = cid;
32 }
33
34 int
35 rx_GetConnectionId(struct rx_connection *conn) {
36     return conn->cid;
37 }
38
39 void
40 rx_SetSecurityData(struct rx_connection *conn, void *data) {
41     conn->securityData = data;
42 }
43
44 void *
45 rx_GetSecurityData(struct rx_connection *conn)
46 {
47     return conn->securityData;
48 }
49
50 int
51 rx_IsUsingPktCksum(struct rx_connection *conn)
52 {
53     return conn->flags & RX_CONN_USING_PACKET_CKSUM;
54 }
55
56 void
57 rx_SetSecurityHeaderSize(struct rx_connection *conn, int size)
58 {
59     conn->securityHeaderSize = size;
60 }
61
62 int
63 rx_GetSecurityHeaderSize(struct rx_connection *conn)
64 {
65     return conn->securityHeaderSize;
66 }
67
68 void
69 rx_SetSecurityMaxTrailerSize(struct rx_connection *conn, int size)
70 {
71     conn->securityMaxTrailerSize = size;
72 }
73
74 int
75 rx_GetSecurityMaxTrailerSize(struct rx_connection *conn)
76 {
77     return conn->securityMaxTrailerSize;
78 }
79
80 void
81 rx_SetServerConnIdleDeadErr(struct rx_connection *conn, int err)
82 {
83     conn->idleDeadErr = err;
84 }
85
86 void
87 rx_SetMsgsizeRetryErr(struct rx_connection *conn, int err)
88 {
89     conn->msgsizeRetryErr = err;
90 }
91
92 int
93 rx_IsServerConn(struct rx_connection *conn)
94 {
95     return conn->type == RX_SERVER_CONNECTION;
96 }
97
98 int
99 rx_IsClientConn(struct rx_connection *conn)
100 {
101     return conn->type == RX_CLIENT_CONNECTION;
102 }
103
104 struct rx_peer *
105 rx_PeerOf(struct rx_connection *conn)
106 {
107     return conn->peer;
108 }
109
110 u_short
111 rx_ServiceIdOf(struct rx_connection *conn)
112 {
113     return conn->serviceId;
114 }
115
116 int
117 rx_SecurityClassOf(struct rx_connection *conn)
118 {
119     return conn->securityIndex;
120 }
121
122 struct rx_securityClass *
123 rx_SecurityObjectOf(const struct rx_connection *conn)
124 {
125     return conn->securityObject;
126 }
127
128 struct rx_service *
129 rx_ServiceOf(struct rx_connection *conn)
130 {
131     return conn->service;
132 }
133
134 int
135 rx_ConnError(struct rx_connection *conn)
136 {
137     return conn->error;
138 }