1 | /* |
---|
2 | * This file Copyright (C) 2008 Charles Kerr <charles@rebelbase.com> |
---|
3 | * |
---|
4 | * This file is licensed by the GPL version 2. Works owned by the |
---|
5 | * Transmission project are granted a special exemption to clause 2(b) |
---|
6 | * so that the bulk of its code can remain under the MIT license. |
---|
7 | * This exemption does not extend to derived works not owned by |
---|
8 | * the Transmission project. |
---|
9 | * |
---|
10 | * $Id: rpc.h 6346 2008-07-16 20:31:17Z charles $ |
---|
11 | */ |
---|
12 | |
---|
13 | #ifndef TR_RPC_H |
---|
14 | #define TR_RPC_H |
---|
15 | |
---|
16 | /*** |
---|
17 | **** RPC processing |
---|
18 | ***/ |
---|
19 | |
---|
20 | enum |
---|
21 | { |
---|
22 | TR_RPC_TORRENT_ACTIVITY = (1<<0), |
---|
23 | TR_RPC_TORRENT_ANNOUNCE = (1<<1), |
---|
24 | TR_RPC_TORRENT_ERROR = (1<<2), |
---|
25 | TR_RPC_TORRENT_FILES = (1<<3), |
---|
26 | TR_RPC_TORRENT_HISTORY = (1<<4), |
---|
27 | TR_RPC_TORRENT_ID = (1<<5), |
---|
28 | TR_RPC_TORRENT_INFO = (1<<6), |
---|
29 | TR_RPC_TORRENT_LIMITS = (1<<7), |
---|
30 | TR_RPC_TORRENT_PEERS = (1<<8), |
---|
31 | TR_RPC_TORRENT_PEER_STATS = (1<<9), |
---|
32 | TR_RPC_TORRENT_PRIORITIES = (1<<10), |
---|
33 | TR_RPC_TORRENT_SCRAPE = (1<<11), |
---|
34 | TR_RPC_TORRENT_SIZE = (1<<12), |
---|
35 | TR_RPC_TORRENT_TRACKER_STATS = (1<<13), |
---|
36 | TR_RPC_TORRENT_TRACKERS = (1<<14), |
---|
37 | TR_RPC_TORRENT_WEBSEEDS = (1<<15) |
---|
38 | }; |
---|
39 | |
---|
40 | struct tr_benc; |
---|
41 | struct tr_handle; |
---|
42 | |
---|
43 | /* http://www.json.org/ */ |
---|
44 | char* |
---|
45 | tr_rpc_request_exec_json( struct tr_handle * handle, |
---|
46 | const void * request_json, |
---|
47 | int request_len, |
---|
48 | int * response_len ); |
---|
49 | |
---|
50 | /* see the RPC spec's "Request URI Notation" section */ |
---|
51 | char* |
---|
52 | tr_rpc_request_exec_uri( struct tr_handle * handle, |
---|
53 | const void * request_uri, |
---|
54 | int request_len, |
---|
55 | int * response_len ); |
---|
56 | |
---|
57 | void |
---|
58 | tr_rpc_parse_list_str( struct tr_benc * setme, |
---|
59 | const char * list_str, |
---|
60 | size_t list_str_len ); |
---|
61 | |
---|
62 | |
---|
63 | #endif |
---|