diff options
Diffstat (limited to 'ot_livesync.h')
| -rw-r--r-- | ot_livesync.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/ot_livesync.h b/ot_livesync.h index d7490e5..cb28774 100644 --- a/ot_livesync.h +++ b/ot_livesync.h | |||
| @@ -28,13 +28,19 @@ | |||
| 28 | Each tracker instance accumulates announce requests until its buffer is | 28 | Each tracker instance accumulates announce requests until its buffer is |
| 29 | full or a timeout is reached. Then it broadcasts its live sync packer: | 29 | full or a timeout is reached. Then it broadcasts its live sync packer: |
| 30 | 30 | ||
| 31 | packet type SYNC_LIVE | 31 | packet type SYNC_LIVE4 |
| 32 | [ 0x0008 0x14 info_hash | 32 | [ 0x0008 0x14 info_hash |
| 33 | 0x001c 0x04 peer's ipv4 address | 33 | 0x001c 0x04 peer's ipv4 address |
| 34 | 0x0020 0x02 peer's port | 34 | 0x0020 0x02 peer's port |
| 35 | 0x0024 0x02 peer flags v1 ( SEEDING = 0x80, COMPLETE = 0x40, STOPPED = 0x20 ) | 35 | 0x0024 0x02 peer flags v1 ( SEEDING = 0x80, COMPLETE = 0x40, STOPPED = 0x20 ) |
| 36 | ]* | 36 | ]* |
| 37 | 37 | ||
| 38 | packet type SYNC_LIVE6 | ||
| 39 | [ 0x0008 0x14 info_hash | ||
| 40 | 0x001c 0x10 peer's ipv6 address | ||
| 41 | 0x002c 0x02 peer's port | ||
| 42 | 0x002e 0x02 peer flags v1 ( SEEDING = 0x80, COMPLETE = 0x40, STOPPED = 0x20 ) | ||
| 43 | ]* | ||
| 38 | */ | 44 | */ |
| 39 | 45 | ||
| 40 | #ifdef WANT_SYNC_LIVE | 46 | #ifdef WANT_SYNC_LIVE |
| @@ -45,18 +51,18 @@ void livesync_init(); | |||
| 45 | void livesync_deinit(); | 51 | void livesync_deinit(); |
| 46 | 52 | ||
| 47 | /* Join multicast group for listening and create sending socket */ | 53 | /* Join multicast group for listening and create sending socket */ |
| 48 | void livesync_bind_mcast( char *ip, uint16_t port ); | 54 | void livesync_bind_mcast(char *ip, uint16_t port); |
| 49 | 55 | ||
| 50 | /* Inform live sync about whats going on. */ | 56 | /* Inform live sync about whats going on. */ |
| 51 | void livesync_tell( struct ot_workstruct *ws ); | 57 | void livesync_tell(struct ot_workstruct *ws); |
| 52 | 58 | ||
| 53 | /* Tickle the live sync module from time to time, so no events get | 59 | /* Tickle the live sync module from time to time, so no events get |
| 54 | stuck when there's not enough traffic to fill udp packets fast | 60 | stuck when there's not enough traffic to fill udp packets fast |
| 55 | enough */ | 61 | enough */ |
| 56 | void livesync_ticker( ); | 62 | void livesync_ticker(); |
| 57 | 63 | ||
| 58 | /* Handle an incoming live sync packet */ | 64 | /* Handle an incoming live sync packet */ |
| 59 | void handle_livesync( const int64 sock ); | 65 | void handle_livesync(const int64 sock); |
| 60 | 66 | ||
| 61 | #else | 67 | #else |
| 62 | 68 | ||
