source: protocols/msn/invitation.h @ a880e34

Last change on this file since a880e34 was 5ebff60, checked in by dequis <dx@…>, at 2015-02-20T22:50:54Z

Reindent everything to K&R style with tabs

Used uncrustify, with the configuration file in ./doc/uncrustify.cfg

Commit author set to "Indent <please@…>" so that it's easier to
skip while doing git blame.

  • Property mode set to 100644
File size: 2.8 KB
Line 
1/********************************************************************\
2* BitlBee -- An IRC to other IM-networks gateway                     *
3*                                                                    *
4* Copyright 2006 Marijn Kruisselbrink and others                     *
5\********************************************************************/
6
7/* MSN module - File transfer support             */
8
9/*
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License with
21 the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL;
22 if not, write to the Free Software Foundation, Inc., 51 Franklin St.,
23 Fifth Floor, Boston, MA  02110-1301  USA
24 */
25
26#ifndef _MSN_INVITATION_H
27#define _MSN_INVITATION_H
28
29#include "msn.h"
30
31#define MSN_INVITE_HEADERS      "MIME-Version: 1.0\r\n" \
32        "Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n" \
33        "\r\n"
34
35#define MSNFTP_PSIZE 2048
36
37typedef enum {
38        MSN_TRANSFER_RECEIVING  = 1,
39        MSN_TRANSFER_SENDING    = 2
40} msn_filetransfer_status_t;
41
42typedef struct msn_filetransfer {
43/* Generic invitation data */
44        /* msn_data instance this invitation was received with. */
45        struct msn_data *md;
46        /* Cookie specifying this invitation. */
47        unsigned int invite_cookie;
48        /* Handle of user that started this invitation. */
49        char *handle;
50
51/* File transfer specific data */
52        /* Current status of the file transfer. */
53        msn_filetransfer_status_t status;
54        /* Pointer to the dcc structure for this transfer. */
55        file_transfer_t *dcc;
56        /* Socket the transfer is taking place over. */
57        int fd;
58        /* Cookie received in the original invitation, this must be sent as soon as
59           a connection has been established. */
60        unsigned int auth_cookie;
61        /* Data remaining to be received in the current packet. */
62        unsigned int data_remaining;
63        /* Buffer containing received, but unprocessed text. */
64        char tbuf[256];
65        unsigned int tbufpos;
66
67        unsigned int data_sent;
68
69        gint r_event_id;
70        gint w_event_id;
71
72        unsigned char sbuf[2048];
73        int sbufpos;
74
75} msn_filetransfer_t;
76
77void msn_invitation_invite(struct msn_switchboard *sb, char *handle, unsigned int cookie, char *body, int blen);
78void msn_invitation_accept(struct msn_switchboard *sb, char *handle, unsigned int cookie, char *body, int blen);
79void msn_invitation_cancel(struct msn_switchboard *sb, char *handle, unsigned int cookie, char *body, int blen);
80
81#endif
Note: See TracBrowser for help on using the repository browser.