summaryrefslogtreecommitdiffstats
path: root/src/peer.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-03-30 02:26:30 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-03-30 02:26:30 +0200
commitca127fccb899627e9e9a69d139bd27d79b30cd54 (patch)
treed6aba2530629cf805fc279dcb2702a3f66cdd177 /src/peer.h
parent4d696a973af61e716959801c88b3ddbeca582e89 (diff)
downloadfastd-ca127fccb899627e9e9a69d139bd27d79b30cd54.tar
fastd-ca127fccb899627e9e9a69d139bd27d79b30cd54.zip
Rework handshake... again. ecfxp protocol broken, will be fixed with next commit.
Diffstat (limited to 'src/peer.h')
-rw-r--r--src/peer.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/peer.h b/src/peer.h
index 725ea9a..0e258a0 100644
--- a/src/peer.h
+++ b/src/peer.h
@@ -75,7 +75,7 @@ fastd_peer_config* fastd_peer_config_new(fastd_context *ctx, fastd_config *conf)
void fastd_peer_reset(fastd_context *ctx, fastd_peer *peer);
fastd_peer* fastd_peer_add(fastd_context *ctx, fastd_peer_config *conf);
fastd_peer* fastd_peer_add_temp(fastd_context *ctx, const fastd_peer_address *address);
-fastd_peer* fastd_peer_merge(fastd_context *ctx, fastd_peer *perm_peer, fastd_peer *temp_peer);
+fastd_peer* fastd_peer_set_established_merge(fastd_context *ctx, fastd_peer *perm_peer, fastd_peer *temp_peer);
const fastd_eth_addr* fastd_get_source_address(const fastd_context *ctx, fastd_buffer buffer);
const fastd_eth_addr* fastd_get_dest_address(const fastd_context *ctx, fastd_buffer buffer);
@@ -89,22 +89,22 @@ static inline bool fastd_peer_is_floating(const fastd_peer *peer) {
}
static inline bool fastd_peer_is_temporary(const fastd_peer *peer) {
- return (peer->state == STATE_TEMP || peer->state == STATE_TEMP_ESTABLISHED);
+ return (peer->state == STATE_TEMP);
}
static inline bool fastd_peer_is_established(const fastd_peer *peer) {
- return (peer->state == STATE_ESTABLISHED || peer->state == STATE_TEMP_ESTABLISHED);
+ return (peer->state == STATE_ESTABLISHED);
}
-static inline void fastd_peer_set_established(fastd_peer *peer) {
+static inline void fastd_peer_set_established(fastd_context *ctx, fastd_peer *peer) {
switch(peer->state) {
case STATE_WAIT:
+ pr_info(ctx, "Connection with %P established.", peer);
peer->state = STATE_ESTABLISHED;
break;
case STATE_TEMP:
- peer->state = STATE_TEMP_ESTABLISHED;
- break;
+ exit_bug(ctx, "tried to set a temporary connection to established");
default:
return;