protocol/peer.h

Go to the documentation of this file.
00001 #ifndef utu_peer_h
00002 #define utu_peer_h
00003 
00004 /*
00005  * Utu -- Saving The Internet With Hate
00006  *
00007  * Copyright (c) Zed A. Shaw 2005 (zedshaw@zedshaw.com)
00008  *
00009  * This file is modifiable/redistributable under the terms of the GNU
00010  * General Public License.
00011  *
00012  * You should have recieved a copy of the GNU General Public License along
00013  * with this program; see the file COPYING. If not, write to the Free Software
00014  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 0211-1307, USA.
00015  */
00016 
00017 
00018 
00019 #include "crypto.h"
00020 #include "frame.h"
00021 
00022 #define PEER_DEFAULT_IO_BUF_SIZE (32 * 1024)
00023 
00032 typedef struct Peer {
00033   CryptState *state;
00034   pool_t *pool;
00035   FrameSource source;
00036   CryptState_key_confirm_cb key_confirm;
00037 } Peer;
00038 
00039 
00050 Peer *Peer_create(CryptState *state, int fd, CryptState_key_confirm_cb key_confirm);
00051 
00052 
00062 void Peer_destroy(Peer *peer, int crypt_too);
00063 
00064 
00078 Node *Peer_recv(Peer *peer, Node **rhdr);
00079 
00080 
00092 int Peer_send(Peer *peer, Node *header, Node *payload);
00093 
00094 
00108 int Peer_establish_initiator(Peer *peer);
00109 
00121 int Peer_establish_receiver(Peer *peer);
00122 
00123 #endif

Generated on Tue Apr 10 01:00:18 2007 for Utu by  doxygen 1.5.1