summaryrefslogtreecommitdiffstats
path: root/src/constants.h
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2013-07-27 16:34:45 +0200
committerSlávek Banko <slavek.banko@axis.cz>2013-07-27 16:34:45 +0200
commitd76ff81b7c1beffef0b84e570914c8f2d47834e6 (patch)
tree284b80ce7c5456fbb041f7979ac2c0baeead8902 /src/constants.h
downloadtork-d76ff81b7c1beffef0b84e570914c8f2d47834e6.tar.gz
tork-d76ff81b7c1beffef0b84e570914c8f2d47834e6.zip
Initial import of tork 0.33
Diffstat (limited to 'src/constants.h')
-rw-r--r--src/constants.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/constants.h b/src/constants.h
new file mode 100644
index 0000000..8f633b2
--- /dev/null
+++ b/src/constants.h
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2006 - 2008 Robert Hogan *
+ * robert@roberthogan.net *
+ * Copyright (C) 2005 by Joris Guisson *
+ * joris.guisson@gmail.com *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+#ifndef BTCONSTANTS_H
+#define BTCONSTANTS_H
+
+namespace bt
+{
+ typedef unsigned long long Uint64;
+ typedef unsigned long Uint32;
+ typedef unsigned short Uint16;
+ typedef unsigned char Uint8;
+
+ typedef long long Int64;
+ typedef long Int32;
+ typedef short Int16;
+ typedef char Int8;
+
+ const Uint32 MAX_MSGLEN = 9 + 131072;
+ const Uint16 MIN_PORT = 6881;
+ const Uint16 MAX_PORT = 6889;
+ const Uint32 MAX_PIECE_LEN = 16384;
+
+ const Uint8 CHOKE = 0;
+ const Uint8 UNCHOKE = 1;
+ const Uint8 INTERESTED = 2;
+ const Uint8 NOT_INTERESTED = 3;
+ const Uint8 HAVE = 4;
+ const Uint8 BITFIELD = 5;
+ const Uint8 REQUEST = 6;
+ const Uint8 PIECE = 7;
+ const Uint8 CANCEL = 8;
+}
+
+
+#endif