cbitcoin
 All Data Structures Files Functions Variables Typedefs
src/CBNetworkFunctions.h
00001 //
00002 //  CBNetworkFunctions.c
00003 //  cbitcoin
00004 //
00005 //  Created by Matthew Mitchell on 01/08/2012.
00006 //  Copyright (c) 2012 Matthew Mitchell
00007 //
00008 //  This file is part of cbitcoin.
00009 //
00010 //  cbitcoin is free software: you can redistribute it and/or modify
00011 //  it under the terms of the GNU General Public License as published by
00012 //  the Free Software Foundation, either version 3 of the License, or
00013 //  (at your option) any later version.
00014 //
00015 //  cbitcoin is distributed in the hope that it will be useful,
00016 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 //  GNU General Public License for more details.
00019 //
00020 //  You should have received a copy of the GNU General Public License
00021 //  along with cbitcoin.  If not, see <http://www.gnu.org/licenses/>.
00022 
00023 #ifndef CBNETWORKFUNCTIONSH
00024 #define CBNETWORKFUNCTIONSH
00025 
00026 #include <stdint.h>
00027 #include <stdbool.h>
00028 #include <string.h>
00029 #include "CBConstants.h"
00030 
00031 static const uint8_t IPv4Start[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF};
00032 static const uint8_t SITTStart[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0, 0};
00033 static const uint8_t RFC6052Start[12] = {0, 0x64, 0xFF, 0x9B, 0, 0, 0, 0, 0, 0, 0, 0};
00034 
00040 CBIPType CBGetIPType(uint8_t * IP);
00046 bool CBIsI2P(uint8_t * IP);
00052 bool CBIsIPv4(uint8_t * IP);
00058 bool CBIsTor(uint8_t * IP);
00059 
00060 #endif