summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <>2007-12-20 05:59:34 +0000
committererdgeist <>2007-12-20 05:59:34 +0000
commitc28cf398fd956eb467612eec4b31e1df371b9636 (patch)
tree8ea7885c689844d06aa59a420fbaf06fee5ded19
parentd9ed6c22bd26268b8ae51cc062e41f20e2dc68bd (diff)
Introduce some kind of versioning
-rw-r--r--Makefile28
-rw-r--r--opentracker.c8
-rw-r--r--opentracker.xcodeproj/project.pbxproj5
-rw-r--r--ot_accesslist.c6
-rw-r--r--ot_accesslist.h4
-rw-r--r--ot_clean.c6
-rw-r--r--ot_clean.h4
-rw-r--r--ot_fullscrape.c6
-rw-r--r--ot_fullscrape.h4
-rw-r--r--ot_http.c6
-rw-r--r--ot_http.h4
-rw-r--r--ot_iovec.c6
-rw-r--r--ot_iovec.h4
-rw-r--r--ot_mutex.c6
-rw-r--r--ot_mutex.h4
-rw-r--r--ot_stats.c17
-rw-r--r--ot_stats.h5
-rw-r--r--ot_sync.c6
-rw-r--r--ot_sync.h4
-rw-r--r--ot_udp.c12
-rw-r--r--ot_udp.h4
-rw-r--r--ot_vector.c6
-rw-r--r--ot_vector.h4
-rw-r--r--scan_urlencoded_query.c6
-rw-r--r--scan_urlencoded_query.h6
-rw-r--r--trackerlogic.c6
-rw-r--r--trackerlogic.h4
27 files changed, 148 insertions, 33 deletions
diff --git a/Makefile b/Makefile
index 3a5ac12..12c89d7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,24 @@
1# $Id$
2
1CC?=gcc 3CC?=gcc
4
5# Linux flavour
6# PREFIX?=/opt/diet
7# LIBOWFAT_HEADERS=$(PREFIX)/include
8# LIBOWFAT_LIBRARY=$(PREIFX)/lib
9
10# BSD flavour
11PREFIX?=/usr/local
12LIBOWFAT_HEADERS=$(PREFIX)/include/libowfat
13LIBOWFAT_LIBRARY=$(PREIFX)/lib
14
15# Debug flavour
16# PREFIX?=..
17# LIBOWFAT_HEADERS=$(PREFIX)/libowfat
18# LIBOWFAT_LIBRARY=$(PREFIX)/libowfat
19
20BINDIR?=$(PREFIX)/bin
21
2#FEATURES =-DWANT_TRACKER_SYNC 22#FEATURES =-DWANT_TRACKER_SYNC
3#FEATURES+=-DWANT_BLACKLISTING 23#FEATURES+=-DWANT_BLACKLISTING
4#FEATURES+=-DWANT_CLOSED_TRACKER 24#FEATURES+=-DWANT_CLOSED_TRACKER
@@ -9,8 +29,9 @@ CC?=gcc
9 29
10OPTS_debug=-g -ggdb #-pg # -fprofile-arcs -ftest-coverage 30OPTS_debug=-g -ggdb #-pg # -fprofile-arcs -ftest-coverage
11OPTS_production=-Os 31OPTS_production=-Os
12CFLAGS+=-I../libowfat -Wall -pipe -Wextra #-pedantic -ansi 32
13LDFLAGS+=-L../libowfat/ -lowfat -pthread -lz 33CFLAGS+=-I$(LIBOWFAT_HEADERS) -Wall -pipe -Wextra #-pedantic -ansi
34LDFLAGS+=-L$(LIBOWFAT_LIBRARY) -lowfat -pthread -lz
14 35
15BINARY =opentracker 36BINARY =opentracker
16HEADERS=trackerlogic.h scan_urlencoded_query.h ot_mutex.h ot_stats.h ot_sync.h ot_vector.h ot_clean.h ot_udp.h ot_iovec.h ot_fullscrape.h ot_accesslist.h ot_http.h 37HEADERS=trackerlogic.h scan_urlencoded_query.h ot_mutex.h ot_stats.h ot_sync.h ot_vector.h ot_clean.h ot_udp.h ot_iovec.h ot_fullscrape.h ot_accesslist.h ot_http.h
@@ -40,3 +61,6 @@ $(BINARY).debug: $(OBJECTS_debug) $(HEADERS)
40 61
41clean: 62clean:
42 rm -rf opentracker opentracker.debug *.o *~ 63 rm -rf opentracker opentracker.debug *.o *~
64
65install:
66 install -m 755 opentracker $(BINDIR)
diff --git a/opentracker.c b/opentracker.c
index 6867946..a3aa827 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -1,7 +1,8 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3 Some of the stuff below is stolen from Fefes example libowfat httpd. 3 Some of the stuff below is stolen from Fefes example libowfat httpd.
4*/ 4
5 $Id$ */
5 6
6/* System */ 7/* System */
7#include <string.h> 8#include <string.h>
@@ -250,7 +251,7 @@ int main( int argc, char **argv ) {
250#endif 251#endif
251 252
252 while( scanon ) { 253 while( scanon ) {
253 switch( getopt( argc, argv, ":i:p:A:P:d:r:" 254 switch( getopt( argc, argv, ":i:p:A:P:d:r:v"
254#ifdef WANT_BLACKLISTING 255#ifdef WANT_BLACKLISTING
255"b:" 256"b:"
256#elif defined( WANT_CLOSED_TRACKER ) 257#elif defined( WANT_CLOSED_TRACKER )
@@ -273,6 +274,7 @@ int main( int argc, char **argv ) {
273 accesslist_blessip( tmpip, 0xffff ); /* Allow everything for now */ 274 accesslist_blessip( tmpip, 0xffff ); /* Allow everything for now */
274 break; 275 break;
275 case 'h': help( argv[0] ); exit( 0 ); 276 case 'h': help( argv[0] ); exit( 0 );
277 case 'v': write( 2, static_inbuf, stats_return_tracker_version( static_inbuf )); exit( 0 );
276 default: 278 default:
277 case '?': usage( argv[0] ); exit( 1 ); 279 case '?': usage( argv[0] ); exit( 1 );
278 } 280 }
@@ -312,3 +314,5 @@ int main( int argc, char **argv ) {
312 314
313 return 0; 315 return 0;
314} 316}
317
318const char *g_version_opentracker_c = "$Source$: $Revision$\n";
diff --git a/opentracker.xcodeproj/project.pbxproj b/opentracker.xcodeproj/project.pbxproj
index bedcc9b..7068fa5 100644
--- a/opentracker.xcodeproj/project.pbxproj
+++ b/opentracker.xcodeproj/project.pbxproj
@@ -39,10 +39,10 @@
39 39
40/* Begin PBXFileReference section */ 40/* Begin PBXFileReference section */
41 6520B7520D036AAF00A43B1F /* libowfat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libowfat.a; path = ../libowfat/libowfat.a; sourceTree = SOURCE_ROOT; }; 41 6520B7520D036AAF00A43B1F /* libowfat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libowfat.a; path = ../libowfat/libowfat.a; sourceTree = SOURCE_ROOT; };
42 6520B8110D0E011000A43B1F /* liblibowfat.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = liblibowfat.a; sourceTree = BUILT_PRODUCTS_DIR; };
42 653A320A0CE7F475007F0D03 /* ot_accesslist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ot_accesslist.h; sourceTree = "<group>"; }; 43 653A320A0CE7F475007F0D03 /* ot_accesslist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ot_accesslist.h; sourceTree = "<group>"; };
43 653A320B0CE7F475007F0D03 /* ot_accesslist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ot_accesslist.c; sourceTree = "<group>"; }; 44 653A320B0CE7F475007F0D03 /* ot_accesslist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ot_accesslist.c; sourceTree = "<group>"; };
44 653A56AC0CE201FF000CF140 /* opentracker */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = opentracker; sourceTree = BUILT_PRODUCTS_DIR; }; 45 653A56AC0CE201FF000CF140 /* opentracker */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = opentracker; sourceTree = BUILT_PRODUCTS_DIR; };
45 653A56AF0CE201FF000CF140 /* liblibowfat.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = liblibowfat.a; path = /Users/erdgeist/Coding/opentracker/build/Debug/liblibowfat.a; sourceTree = "<absolute>"; };
46 653A56B30CE28EC5000CF140 /* ot_iovec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ot_iovec.h; sourceTree = "<group>"; }; 46 653A56B30CE28EC5000CF140 /* ot_iovec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ot_iovec.h; sourceTree = "<group>"; };
47 653A56B40CE28EC5000CF140 /* ot_iovec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ot_iovec.c; sourceTree = "<group>"; }; 47 653A56B40CE28EC5000CF140 /* ot_iovec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ot_iovec.c; sourceTree = "<group>"; };
48 654A80840CD832FC009035DE /* opentracker.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = opentracker.c; sourceTree = "<group>"; }; 48 654A80840CD832FC009035DE /* opentracker.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = opentracker.c; sourceTree = "<group>"; };
@@ -124,6 +124,7 @@
124 children = ( 124 children = (
125 653A56AC0CE201FF000CF140 /* opentracker */, 125 653A56AC0CE201FF000CF140 /* opentracker */,
126 6520B7520D036AAF00A43B1F /* libowfat.a */, 126 6520B7520D036AAF00A43B1F /* libowfat.a */,
127 6520B8110D0E011000A43B1F /* liblibowfat.a */,
127 ); 128 );
128 name = Products; 129 name = Products;
129 sourceTree = "<group>"; 130 sourceTree = "<group>";
@@ -182,7 +183,7 @@
182 ); 183 );
183 name = libowfat; 184 name = libowfat;
184 productName = libowfat; 185 productName = libowfat;
185 productReference = 653A56AF0CE201FF000CF140 /* liblibowfat.a */; 186 productReference = 6520B8110D0E011000A43B1F /* liblibowfat.a */;
186 productType = "com.apple.product-type.library.static"; 187 productType = "com.apple.product-type.library.static";
187 }; 188 };
188 8DD76FA90486AB0100D96B5E /* opentracker */ = { 189 8DD76FA90486AB0100D96B5E /* opentracker */ = {
diff --git a/ot_accesslist.c b/ot_accesslist.c
index 38b1bdf..df3d64c 100644
--- a/ot_accesslist.c
+++ b/ot_accesslist.c
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4/* System */ 6/* System */
5#include <stdlib.h> 7#include <stdlib.h>
@@ -116,3 +118,5 @@ int accesslist_isblessed( char *ip, ot_permissions permissions ) {
116 return 1; 118 return 1;
117 return 0; 119 return 0;
118} 120}
121
122const char *g_version_accesslist_c = "$Source$: $Revision$\n";
diff --git a/ot_accesslist.h b/ot_accesslist.h
index d0d674a..6adefd9 100644
--- a/ot_accesslist.h
+++ b/ot_accesslist.h
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4#ifndef __OT_ACCESSLIST_H__ 6#ifndef __OT_ACCESSLIST_H__
5#define __OT_ACCESSLIST_H__ 7#define __OT_ACCESSLIST_H__
diff --git a/ot_clean.c b/ot_clean.c
index 308c848..a45a3dc 100644
--- a/ot_clean.c
+++ b/ot_clean.c
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4/* System */ 6/* System */
5#include <stdlib.h> 7#include <stdlib.h>
@@ -129,3 +131,5 @@ void clean_init( void ) {
129void clean_deinit( void ) { 131void clean_deinit( void ) {
130 pthread_cancel( thread_id ); 132 pthread_cancel( thread_id );
131} 133}
134
135const char *g_version_clean_c = "$Source$: $Revision$\n";
diff --git a/ot_clean.h b/ot_clean.h
index 8ad1ae8..a06891e 100644
--- a/ot_clean.h
+++ b/ot_clean.h
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4#ifndef __OT_CLEAN_H__ 6#ifndef __OT_CLEAN_H__
5#define __OT_CLEAN_H__ 7#define __OT_CLEAN_H__
diff --git a/ot_fullscrape.c b/ot_fullscrape.c
index d40e471..f9129e4 100644
--- a/ot_fullscrape.c
+++ b/ot_fullscrape.c
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4/* System */ 6/* System */
5#include <sys/uio.h> 7#include <sys/uio.h>
@@ -223,3 +225,5 @@ static void fullscrape_make( int *iovec_entries, struct iovec **iovector, ot_tas
223 /* Release unused memory in current output buffer */ 225 /* Release unused memory in current output buffer */
224 iovec_fixlast( iovec_entries, iovector, r ); 226 iovec_fixlast( iovec_entries, iovector, r );
225} 227}
228
229const char *g_version_fullscrape_c = "$Source$: $Revision$\n";
diff --git a/ot_fullscrape.h b/ot_fullscrape.h
index 7666e6c..ccd39f4 100644
--- a/ot_fullscrape.h
+++ b/ot_fullscrape.h
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4#ifndef __OT_FULLSCRAPE_H__ 6#ifndef __OT_FULLSCRAPE_H__
5#define __OT_FULLSCRAPE_H__ 7#define __OT_FULLSCRAPE_H__
diff --git a/ot_http.c b/ot_http.c
index a377e84..232911b 100644
--- a/ot_http.c
+++ b/ot_http.c
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4/* System */ 6/* System */
5#include <sys/types.h> 7#include <sys/types.h>
@@ -568,3 +570,5 @@ ssize_t http_handle_request( const int64 client_socket, char *data, size_t recv_
568 http_senddata( client_socket, static_outbuf + reply_off, reply_size ); 570 http_senddata( client_socket, static_outbuf + reply_off, reply_size );
569 return reply_size; 571 return reply_size;
570} 572}
573
574const char *g_version_http_c = "$Source$: $Revision$\n";
diff --git a/ot_http.h b/ot_http.h
index a64cf19..3570042 100644
--- a/ot_http.h
+++ b/ot_http.h
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4#ifndef __OT_HTTP_H__ 6#ifndef __OT_HTTP_H__
5#define __OT_HTTP_H__ 7#define __OT_HTTP_H__
diff --git a/ot_iovec.c b/ot_iovec.c
index f71d4d7..70e017c 100644
--- a/ot_iovec.c
+++ b/ot_iovec.c
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4/* System */ 6/* System */
5#include <sys/types.h> 7#include <sys/types.h>
@@ -71,3 +73,5 @@ size_t iovec_length( int *iovec_entries, struct iovec **iovector ) {
71 length += ((*iovector)[i]).iov_len; 73 length += ((*iovector)[i]).iov_len;
72 return length; 74 return length;
73} 75}
76
77const char *g_version_iovec_c = "$Source$: $Revision$\n";
diff --git a/ot_iovec.h b/ot_iovec.h
index d7105bd..02373e7 100644
--- a/ot_iovec.h
+++ b/ot_iovec.h
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4#ifndef __OT_IOVEC_H__ 6#ifndef __OT_IOVEC_H__
5#define __OT_IOVEC_H__ 7#define __OT_IOVEC_H__
diff --git a/ot_mutex.c b/ot_mutex.c
index 6bcaf12..5f51299 100644
--- a/ot_mutex.c
+++ b/ot_mutex.c
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4/* System */ 6/* System */
5#include <pthread.h> 7#include <pthread.h>
@@ -316,3 +318,5 @@ void mutex_deinit( ) {
316 pthread_cond_destroy(&tasklist_being_filled); 318 pthread_cond_destroy(&tasklist_being_filled);
317 byte_zero( all_torrents, sizeof( all_torrents ) ); 319 byte_zero( all_torrents, sizeof( all_torrents ) );
318} 320}
321
322const char *g_version_mutex_c = "$Source$: $Revision$\n";
diff --git a/ot_mutex.h b/ot_mutex.h
index c098343..063eb08 100644
--- a/ot_mutex.h
+++ b/ot_mutex.h
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4#ifndef __OT_MUTEX_H__ 6#ifndef __OT_MUTEX_H__
5#define __OT_MUTEX_H__ 7#define __OT_MUTEX_H__
diff --git a/ot_stats.c b/ot_stats.c
index 417e194..fa783d8 100644
--- a/ot_stats.c
+++ b/ot_stats.c
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4/* System */ 6/* System */
5#include <stdlib.h> 7#include <stdlib.h>
@@ -334,6 +336,18 @@ static size_t stats_httperrors_txt ( char * reply ) {
334 ot_failed_request_counts[6] ); 336 ot_failed_request_counts[6] );
335} 337}
336 338
339extern const char
340*g_version_opentracker_c, *g_version_accesslist_c, *g_version_clean_c, *g_version_fullscrape_c, *g_version_http_c,
341*g_version_iovec_c, *g_version_mutex_c, *g_version_stats_c, *g_version_sync_c, *g_version_udp_c, *g_version_vector_c,
342*g_version_scan_urlencoded_query_c, *g_version_trackerlogic_c;
343
344size_t stats_return_tracker_version( char *reply ) {
345 return sprintf( reply, "%s%s%s%s%s%s%s%s%s%s%s%s%s",
346 g_version_opentracker_c, g_version_accesslist_c, g_version_clean_c, g_version_fullscrape_c, g_version_http_c,
347 g_version_iovec_c, g_version_mutex_c, g_version_stats_c, g_version_sync_c, g_version_udp_c, g_version_vector_c,
348 g_version_scan_urlencoded_query_c, g_version_trackerlogic_c );
349}
350
337size_t return_stats_for_tracker( char *reply, int mode, int format ) { 351size_t return_stats_for_tracker( char *reply, int mode, int format ) {
338 format = format; 352 format = format;
339 switch( mode ) { 353 switch( mode ) {
@@ -418,3 +432,4 @@ void stats_deinit( ) {
418 432
419} 433}
420 434
435const char *g_version_stats_c = "$Source$: $Revision$\n";
diff --git a/ot_stats.h b/ot_stats.h
index 8ea8668..c07a950 100644
--- a/ot_stats.h
+++ b/ot_stats.h
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4#ifndef __OT_STATS_H__ 6#ifndef __OT_STATS_H__
5#define __OT_STATS_H__ 7#define __OT_STATS_H__
@@ -34,6 +36,7 @@ enum {
34 36
35void stats_issue_event( ot_status_event event, int is_tcp, size_t event_data ); 37void stats_issue_event( ot_status_event event, int is_tcp, size_t event_data );
36size_t return_stats_for_tracker( char *reply, int mode, int format ); 38size_t return_stats_for_tracker( char *reply, int mode, int format );
39size_t stats_return_tracker_version( char *reply );
37void stats_init( ); 40void stats_init( );
38void stats_deinit( ); 41void stats_deinit( );
39 42
diff --git a/ot_sync.c b/ot_sync.c
index ac1664d..5f772fb 100644
--- a/ot_sync.c
+++ b/ot_sync.c
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4/* System */ 6/* System */
5#include <sys/types.h> 7#include <sys/types.h>
@@ -160,3 +162,5 @@ void sync_deliver( int64 socket ) {
160} 162}
161 163
162#endif 164#endif
165
166const char *g_version_sync_c = "$Source$: $Revision$\n";
diff --git a/ot_sync.h b/ot_sync.h
index af7db8f..210d9d7 100644
--- a/ot_sync.h
+++ b/ot_sync.h
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4#ifndef __OT_SYNC_H__ 6#ifndef __OT_SYNC_H__
5#define __OT_SYNC_H__ 7#define __OT_SYNC_H__
diff --git a/ot_udp.c b/ot_udp.c
index 786855b..e1af2fe 100644
--- a/ot_udp.c
+++ b/ot_udp.c
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4/* System */ 6/* System */
5#include <string.h> 7#include <string.h>
@@ -22,19 +24,21 @@ static const uint8_t g_static_connid[8] = { 0x23, 0x42, 0x05, 0x17, 0xde, 0x41,
22 24
23static void udp_make_connectionid( uint32_t * connid, const char * remoteip ) { 25static void udp_make_connectionid( uint32_t * connid, const char * remoteip ) {
24 /* Touch unused variable */ 26 /* Touch unused variable */
25 remoteip = remoteip; 27 (void)remoteip;
26 28
27 /* Use a static secret for now */ 29 /* Use a static secret for now */
28 memcpy( connid, g_static_connid, 8 ); 30 memcpy( connid, g_static_connid, 8 );
29} 31}
30 32
33#if 0
31static int udp_test_connectionid( const uint32_t * const connid, const char * remoteip ) { 34static int udp_test_connectionid( const uint32_t * const connid, const char * remoteip ) {
32 /* Touch unused variable */ 35 /* Touch unused variable */
33 remoteip = remoteip; 36 (void)remoteip;
34 37
35 /* Test against our static secret */ 38 /* Test against our static secret */
36 return !memcmp( connid, g_static_connid, 8 ); 39 return !memcmp( connid, g_static_connid, 8 );
37} 40}
41#endif
38 42
39/* UDP implementation according to http://xbtt.sourceforge.net/udp_tracker_protocol.html */ 43/* UDP implementation according to http://xbtt.sourceforge.net/udp_tracker_protocol.html */
40void handle_udp4( int64 serversocket ) { 44void handle_udp4( int64 serversocket ) {
@@ -133,3 +137,5 @@ void handle_udp4( int64 serversocket ) {
133 break; 137 break;
134 } 138 }
135} 139}
140
141const char *g_version_udp_c = "$Source$: $Revision$\n";
diff --git a/ot_udp.h b/ot_udp.h
index 437e8ad..364c9d0 100644
--- a/ot_udp.h
+++ b/ot_udp.h
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4#ifndef __OT_UDP_H__ 6#ifndef __OT_UDP_H__
5#define __OT_UDP_H__ 7#define __OT_UDP_H__
diff --git a/ot_vector.c b/ot_vector.c
index 1cfa4df..2a6d1b3 100644
--- a/ot_vector.c
+++ b/ot_vector.c
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4/* System */ 6/* System */
5#include <stdlib.h> 7#include <stdlib.h>
@@ -108,3 +110,5 @@ void vector_remove_torrent( ot_vector *vector, ot_torrent *match ) {
108 vector->data = realloc( vector->data, vector->space * sizeof( ot_torrent ) ); 110 vector->data = realloc( vector->data, vector->space * sizeof( ot_torrent ) );
109 } 111 }
110} 112}
113
114const char *g_version_vector_c = "$Source$: $Revision$\n";
diff --git a/ot_vector.h b/ot_vector.h
index ed235a3..8f3143b 100644
--- a/ot_vector.h
+++ b/ot_vector.h
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4#ifndef __OT_VECTOR_H__ 6#ifndef __OT_VECTOR_H__
5#define __OT_VECTOR_H__ 7#define __OT_VECTOR_H__
diff --git a/scan_urlencoded_query.c b/scan_urlencoded_query.c
index e0c2e30..85f0d82 100644
--- a/scan_urlencoded_query.c
+++ b/scan_urlencoded_query.c
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4#include "scan.h" 6#include "scan.h"
5#include "scan_urlencoded_query.h" 7#include "scan_urlencoded_query.h"
@@ -134,3 +136,5 @@ ssize_t scan_fixed_ip( char *data, size_t len, unsigned char ip[4] ) {
134 } 136 }
135 return len; 137 return len;
136} 138}
139
140const char *g_version_scan_urlencoded_query_c = "$Source$: $Revision$\n";
diff --git a/scan_urlencoded_query.h b/scan_urlencoded_query.h
index f0ad781..a253aaa 100644
--- a/scan_urlencoded_query.h
+++ b/scan_urlencoded_query.h
@@ -1,6 +1,8 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3 3
4 $id$ */
5
4#ifndef __SCAN_URLENCODED_QUERY_H__ 6#ifndef __SCAN_URLENCODED_QUERY_H__
5#define __SCAN_URLENCODED_QUERY_H__ 7#define __SCAN_URLENCODED_QUERY_H__
6 8
diff --git a/trackerlogic.c b/trackerlogic.c
index 69bcaf8..f4bdf0b 100644
--- a/trackerlogic.c
+++ b/trackerlogic.c
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4/* System */ 6/* System */
5#include <stdlib.h> 7#include <stdlib.h>
@@ -354,3 +356,5 @@ void trackerlogic_deinit( void ) {
354 clean_deinit( ); 356 clean_deinit( );
355 mutex_deinit( ); 357 mutex_deinit( );
356} 358}
359
360const char *g_version_trackerlogic_c = "$Source$: $Revision$\n";
diff --git a/trackerlogic.h b/trackerlogic.h
index eefc038..3525421 100644
--- a/trackerlogic.h
+++ b/trackerlogic.h
@@ -1,5 +1,7 @@
1/* This software was written by Dirk Engling <erdgeist@erdgeist.org> 1/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2 It is considered beerware. Prost. Skol. Cheers or whatever. */ 2 It is considered beerware. Prost. Skol. Cheers or whatever.
3
4 $id$ */
3 5
4#ifndef __OT_TRACKERLOGIC_H__ 6#ifndef __OT_TRACKERLOGIC_H__
5#define __OT_TRACKERLOGIC_H__ 7#define __OT_TRACKERLOGIC_H__