upgrade obexd to 0.47
[profile/ivi/obexd.git] / src / service.h
1 /*
2  *
3  *  OBEX Server
4  *
5  *  Copyright (C) 2007-2010  Marcel Holtmann <marcel@holtmann.org>
6  *
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21  *
22  */
23
24 #define OBEX_PORT_RANDOM UINT16_MAX
25
26 struct obex_service_driver {
27         const char *name;
28         uint16_t service;
29         uint8_t channel;
30         uint16_t port;
31         gboolean secure;
32         const uint8_t *target;
33         unsigned int target_size;
34         const uint8_t *who;
35         unsigned int who_size;
36         const char *record;
37         void *(*connect) (struct obex_session *os, int *err);
38         void (*progress) (struct obex_session *os, void *user_data);
39         int (*get) (struct obex_session *os, void *user_data);
40         int (*put) (struct obex_session *os, void *user_data);
41         int (*chkput) (struct obex_session *os, void *user_data);
42         int (*setpath) (struct obex_session *os, void *user_data);
43         int (*action) (struct obex_session *os, void *user_data);
44         void (*disconnect) (struct obex_session *os, void *user_data);
45         void (*reset) (struct obex_session *os, void *user_data);
46 };
47
48 int obex_service_driver_register(struct obex_service_driver *driver);
49 void obex_service_driver_unregister(struct obex_service_driver *driver);
50 GSList *obex_service_driver_list(uint16_t services);
51 struct obex_service_driver *obex_service_driver_find(GSList *drivers,
52                         const uint8_t *target, unsigned int target_size,
53                         const uint8_t *who, unsigned int who_size);