public
Description: MSN Messenger library in C
Homepage: http://code.google.com/p/msn-pecan/
Clone URL: git://github.com/felipec/msn-pecan.git
felipec (author)
Mon Jun 15 15:42:41 -0700 2009
commit  f201bbd07e320d340f4fc95aa60d44e45b339074
tree    8722f6515a80ac5fc410035fe504da12af5ce742
parent  1faf20cf809614fd09d01b1b23fdf90eaaa9f9af
msn-pecan / directconn.h
100644 69 lines (55 sloc) 2.044 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/**
* Copyright (C) 2007-2009 Felipe Contreras
*
* Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
* source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
 
#ifndef MSN_DIRECTCONN_H
#define MSN_DIRECTCONN_H
 
typedef struct MsnDirectConn MsnDirectConn;
 
#include "cvr/slplink.h"
#include "cvr/slp.h"
 
#include "cmd/msg.h"
#include "io/pecan_stream.h"
 
struct PecanNode;
struct _PurpleProxyConnectData;
 
struct MsnDirectConn
{
    MsnSlpLink *slplink;
    MsnSlpCall *initial_call;
 
    gboolean ack_sent;
    gboolean ack_recv;
 
    char *nonce;
 
    guint read_watch;
    gboolean connected;
 
    int port;
 
    int c;
    struct _PurpleProxyConnectData *connect_data;
    PecanStream *stream;
};
 
MsnDirectConn *msn_directconn_new(MsnSlpLink *slplink);
gboolean msn_directconn_connect(MsnDirectConn *directconn,
                                const char *host, int port);
#if 0
void msn_directconn_listen(MsnDirectConn *directconn);
#endif
void msn_directconn_send_msg(MsnDirectConn *directconn, MsnMessage *msg);
void msn_directconn_parse_nonce(MsnDirectConn *directconn, const char *nonce);
void msn_directconn_destroy(MsnDirectConn *directconn);
void msn_directconn_send_handshake(MsnDirectConn *directconn);
 
#endif /* MSN_DIRECTCONN_H */