Lines Matching refs:peer
68 static inline dtls_security_parameters_t *dtls_security_params_epoch(dtls_peer_t *peer, uint16_t ep… in dtls_security_params_epoch() argument
70 if (peer->security_params[0] && peer->security_params[0]->epoch == epoch) { in dtls_security_params_epoch()
71 return peer->security_params[0]; in dtls_security_params_epoch()
72 } else if (peer->security_params[1] && peer->security_params[1]->epoch == epoch) { in dtls_security_params_epoch()
73 return peer->security_params[1]; in dtls_security_params_epoch()
79 static inline dtls_security_parameters_t *dtls_security_params(dtls_peer_t *peer) in dtls_security_params() argument
81 return peer->security_params[0]; in dtls_security_params()
84 static inline dtls_security_parameters_t *dtls_security_params_next(dtls_peer_t *peer) in dtls_security_params_next() argument
86 if (peer->security_params[1]) in dtls_security_params_next()
87 dtls_security_free(peer->security_params[1]); in dtls_security_params_next()
89 peer->security_params[1] = dtls_security_new(); in dtls_security_params_next()
90 if (!peer->security_params[1]) { in dtls_security_params_next()
93 peer->security_params[1]->epoch = peer->security_params[0]->epoch + 1; in dtls_security_params_next()
94 return peer->security_params[1]; in dtls_security_params_next()
97 static inline void dtls_security_params_free_other(dtls_peer_t *peer) in dtls_security_params_free_other() argument
99 dtls_security_parameters_t * security0 = peer->security_params[0]; in dtls_security_params_free_other()
100 dtls_security_parameters_t * security1 = peer->security_params[1]; in dtls_security_params_free_other()
106 peer->security_params[1] = NULL; in dtls_security_params_free_other()
109 static inline void dtls_security_params_switch(dtls_peer_t *peer) in dtls_security_params_switch() argument
111 dtls_security_parameters_t * security = peer->security_params[1]; in dtls_security_params_switch()
113 peer->security_params[1] = peer->security_params[0]; in dtls_security_params_switch()
114 peer->security_params[0] = security; in dtls_security_params_switch()
133 void dtls_free_peer(dtls_peer_t *peer);
136 static inline dtls_state_t dtls_peer_state(const dtls_peer_t *peer) { in dtls_peer_state() argument
137 return peer->state; in dtls_peer_state()
144 static inline int dtls_peer_is_connected(const dtls_peer_t *peer) { in dtls_peer_is_connected() argument
145 return peer->state == DTLS_STATE_CONNECTED; in dtls_peer_is_connected()