1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Use vector instead of lists everywhere

This commit is contained in:
Matias Fontanini
2017-05-13 11:14:11 -07:00
parent 80f424b6b3
commit 8021112fea
16 changed files with 19 additions and 35 deletions

View File

@@ -30,7 +30,6 @@
#ifndef TINS_DHCP_H
#define TINS_DHCP_H
#include <list>
#include <vector>
#include <string>
#include "bootp.h"
@@ -170,7 +169,7 @@ public:
/**
* The type used to store the DHCP options.
*/
typedef std::list<option> options_type;
typedef std::vector<option> options_type;
/**
* \brief Extracts metadata for this protocol based on the buffer provided
@@ -436,8 +435,7 @@ public:
* If the option is not found, an option_not_found exception
* is thrown.
*
* \return std::list<ipaddress_type> Contanining the DNS servers
* provided.
* \return The list of DNS servers provided.
*/
std::vector<ipaddress_type> domain_name_servers() const;

View File

@@ -31,7 +31,6 @@
#define TINS_DHCPV6_H
#include <cstring>
#include <list>
#include "pdu.h"
#include "macros.h"
#include "endianness.h"
@@ -163,7 +162,7 @@ public:
/**
* The type used to store the DHCPv6 options.
*/
typedef std::list<option> options_type;
typedef std::vector<option> options_type;
/**
* The type used to store IP addresses.

View File

@@ -31,7 +31,6 @@
#define TINS_DNS_H
#include <stdint.h>
#include <list>
#include <vector>
#include <cstring>
#include <string>
@@ -602,8 +601,8 @@ public:
TINS_DEPRECATED(typedef query Query);
TINS_DEPRECATED(typedef resource Resource);
typedef std::list<query> queries_type;
typedef std::list<resource> resources_type;
typedef std::vector<query> queries_type;
typedef std::vector<resource> resources_type;
typedef IPv4Address address_type;
typedef IPv6Address address_v6_type;

View File

@@ -32,7 +32,6 @@
#if !defined(TINS_DOT11_DOT11_H) && defined(TINS_HAVE_DOT11)
#define TINS_DOT11_DOT11_H
#include <list>
#include "../pdu.h"
#include "../pdu_option.h"
#include "../small_uint.h"
@@ -67,7 +66,7 @@ public:
/**
* The type used to store tagged options.
*/
typedef std::list<option> options_type;
typedef std::vector<option> options_type;
/**
* \brief This PDU's flag.

View File

@@ -31,7 +31,6 @@
#define TINS_ICMP_EXTENSION_H
#include <vector>
#include <list>
#include <stdint.h>
#include "macros.h"
#include "small_uint.h"
@@ -176,7 +175,7 @@ public:
/**
* The type used to store the list of ICMP extensions in this structure
*/
typedef std::list<ICMPExtension> extensions_type;
typedef std::vector<ICMPExtension> extensions_type;
/**
* \brief Default constructor

View File

@@ -30,7 +30,6 @@
#ifndef TINS_ICMPV6_H
#define TINS_ICMPV6_H
#include <list>
#include <vector>
#include "macros.h"
#include "pdu.h"
@@ -155,7 +154,7 @@ public:
/**
* The type used to store options.
*/
typedef std::list<option> options_type;
typedef std::vector<option> options_type;
/**
* \brief The type used to store the new home agent information
@@ -548,13 +547,13 @@ public:
/*
* The type used to store all multicast address records in a packet
*/
typedef std::list<multicast_address_record> multicast_address_records_list;
typedef std::vector<multicast_address_record> multicast_address_records_list;
/*
* The type used to store all source address (from Multicast
* Listener Query messages) in a packet
*/
typedef std::list<ipaddress_type> sources_list;
typedef std::vector<ipaddress_type> sources_list;
/**
* \brief Constructs an ICMPv6 object.

View File

@@ -30,7 +30,6 @@
#ifndef TINS_IP_H
#define TINS_IP_H
#include <list>
#include "pdu.h"
#include "small_uint.h"
#include "endianness.h"
@@ -244,7 +243,7 @@ public:
/**
* The type used to store IP options.
*/
typedef std::list<option> options_type;
typedef std::vector<option> options_type;
/**
* \brief Extracts metadata for this protocol based on the buffer provided

View File

@@ -30,7 +30,6 @@
#ifndef TINS_IPV6_h
#define TINS_IPV6_h
#include <list>
#include "macros.h"
#include "pdu.h"
#include "endianness.h"
@@ -71,7 +70,7 @@ public:
/**
* The type used to store the extension headers.
*/
typedef std::list<ext_header> headers_type;
typedef std::vector<ext_header> headers_type;
/**
* The values used to identify extension headers.

View File

@@ -30,7 +30,6 @@
#ifndef TINS_IEEE8022_H
#define TINS_IEEE8022_H
#include <list>
#include <vector>
#include <stdint.h>
#include "macros.h"
@@ -399,7 +398,7 @@ private:
#endif
typedef std::vector<uint8_t> field_type;
typedef std::list<field_type> field_list;
typedef std::vector<field_type> field_list;
void write_serialization(uint8_t* buffer, uint32_t total_sz);

View File

@@ -30,7 +30,6 @@
#ifndef TINS_PPPoE_H
#define TINS_PPPoE_H
#include <list>
#include <string>
#include <vector>
#include "pdu.h"
@@ -82,7 +81,7 @@ public:
/**
* The type used to store the options.
*/
typedef std::list<tag> tags_type;
typedef std::vector<tag> tags_type;
/**
* The type used to store the Vendor-Specific tag's value.

View File

@@ -30,8 +30,6 @@
#ifndef TINS_TCP_H
#define TINS_TCP_H
#include <list>
#include <vector>
#include <stdint.h>
#include <utility>
@@ -131,7 +129,7 @@ public:
/**
* The type used to store the options.
*/
typedef std::list<option> options_type;
typedef std::vector<option> options_type;
/**
* The type used to store the sack option.