From aa3b55302ba1c6625df0ae9a83faafdb61c86106 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 11 Dec 2018 23:58:58 +0000 Subject: [PATCH] Remove dead address_info code --- include/llarp/address_info.h | 91 ---------------------------------- include/llarp/address_info.hpp | 3 ++ llarp/address_info.hpp | 11 ---- 3 files changed, 3 insertions(+), 102 deletions(-) delete mode 100644 include/llarp/address_info.h delete mode 100644 llarp/address_info.hpp diff --git a/include/llarp/address_info.h b/include/llarp/address_info.h deleted file mode 100644 index 28b6c44df..000000000 --- a/include/llarp/address_info.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef LLARP_AI_H -#define LLARP_AI_H -#include -#include -#include -#include - -/** - * address_info.h - * - * utilities for handling addresses on the llarp network - */ - -#define MAX_AI_DIALECT_SIZE 5 - -/// address information model -struct llarp_ai -{ - uint16_t rank; - char dialect[MAX_AI_DIALECT_SIZE + 1]; - byte_t enc_key[PUBKEYSIZE]; - struct in6_addr ip; - uint16_t port; -}; - -/// convert address information struct to bencoded buffer -bool -llarp_ai_bencode(struct llarp_ai *ai, llarp_buffer_t *buff); - -/// convert bencoded buffer to address information struct -bool -llarp_ai_bdecode(struct llarp_ai *ai, llarp_buffer_t *buff); - -struct llarp_ai_list; - -/// list of address information initialization -struct llarp_ai_list * -llarp_ai_list_new(); - -/// list of address information destruction -void -llarp_ai_list_free(struct llarp_ai_list *l); - -/// copy AI -void -llarp_ai_copy(struct llarp_ai *dst, struct llarp_ai *src); - -/// convert llarp_ai_list struct to bencoded buffer -bool -llarp_ai_list_bencode(struct llarp_ai_list *l, llarp_buffer_t *buff); - -/// convert bencoded buffer to llarp_ai_list struct -bool -llarp_ai_list_bdecode(struct llarp_ai_list *l, llarp_buffer_t *buff); - -/// return and remove first element from ai_list -struct llarp_ai -llarp_ai_list_popfront(struct llarp_ai_list *l); - -/// pushes a copy of ai to the end of the list -void -llarp_ai_list_pushback(struct llarp_ai_list *l, struct llarp_ai *ai); - -/// get the number of entries in list -size_t -llarp_ai_list_size(struct llarp_ai_list *l); - -void -llarp_ai_list_copy(struct llarp_ai_list *dst, struct llarp_ai_list *src); - -/// does this index exist in list -bool -llarp_ai_list_index(struct llarp_ai_list *l, ssize_t idx, - struct llarp_ai *result); - -/// ai_list iterator configuration -struct llarp_ai_list_iter -{ - /// a customizable pointer to pass data to iteration functor - void *user; - /// set by llarp_ai_list_iterate() - struct llarp_ai_list *list; - /// return false to break iteration early - bool (*visit)(struct llarp_ai_list_iter *, struct llarp_ai *); -}; - -/// iterator over list and call visit functor -void -llarp_ai_list_iterate(struct llarp_ai_list *l, struct llarp_ai_list_iter *iter); - -#endif diff --git a/include/llarp/address_info.hpp b/include/llarp/address_info.hpp index d2ca8631e..1d229ec9c 100644 --- a/include/llarp/address_info.hpp +++ b/include/llarp/address_info.hpp @@ -1,5 +1,7 @@ #ifndef LLARP_AI_HPP #define LLARP_AI_HPP + +#include #include #include #include @@ -7,6 +9,7 @@ #include #include +#include /** * address_info.hpp diff --git a/llarp/address_info.hpp b/llarp/address_info.hpp deleted file mode 100644 index 3cc3be139..000000000 --- a/llarp/address_info.hpp +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef LLARP_ADDRESS_INFO_HPP -#define LLARP_ADDRESS_INFO_HPP -#include -#include - -struct llarp_ai_list -{ - std::vector< llarp_ai > list; -}; - -#endif \ No newline at end of file