Fix Line Endings
This commit is contained in:
+24
-24
@@ -1,24 +1,24 @@
|
||||
#ifndef CLASS_H
|
||||
#define CLASS_H
|
||||
|
||||
|
||||
namespace Network {
|
||||
namespace Dns {
|
||||
|
||||
class Class
|
||||
{
|
||||
public:
|
||||
enum type
|
||||
{
|
||||
NONE = 0,
|
||||
IN = 1,
|
||||
CS = 2,
|
||||
CH = 3,
|
||||
HS = 4
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace Dns
|
||||
} // namespace Network
|
||||
|
||||
#endif // CLASS_H
|
||||
#ifndef CLASS_H
|
||||
#define CLASS_H
|
||||
|
||||
|
||||
namespace Network {
|
||||
namespace Dns {
|
||||
|
||||
class Class
|
||||
{
|
||||
public:
|
||||
enum type
|
||||
{
|
||||
NONE = 0,
|
||||
IN = 1,
|
||||
CS = 2,
|
||||
CH = 3,
|
||||
HS = 4
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace Dns
|
||||
} // namespace Network
|
||||
|
||||
#endif // CLASS_H
|
||||
|
||||
+73
-73
@@ -1,73 +1,73 @@
|
||||
#ifndef NAME_H
|
||||
#define NAME_H
|
||||
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace Network {
|
||||
namespace Dns {
|
||||
|
||||
class NameImpl;
|
||||
|
||||
class Name
|
||||
{
|
||||
public:
|
||||
Name();
|
||||
|
||||
template<typename ...Args>
|
||||
Name(const Args& ...args) :
|
||||
Name(toStringVector(args...))
|
||||
{
|
||||
}
|
||||
|
||||
Name(const std::vector<std::string>& labels);
|
||||
|
||||
std::string GetFirstLabel() const;
|
||||
std::string GetName() const;
|
||||
bool empty() const;
|
||||
bool endsWith(const Name& suffix) const;
|
||||
|
||||
void append(const std::string& label);
|
||||
void prepend(const std::string& label);
|
||||
|
||||
void swap(Name& x) noexcept;
|
||||
|
||||
bool operator==(const Name& name) const;
|
||||
bool operator!=(const Name& name) const;
|
||||
bool operator<(const Name& name) const;
|
||||
|
||||
private:
|
||||
Name(std::shared_ptr<NameImpl> pNameImpl);
|
||||
NameImpl* PImpl() const;
|
||||
|
||||
private:
|
||||
template <class T>
|
||||
std::string toString(T&& t)
|
||||
{
|
||||
std::stringstream s;
|
||||
s << std::forward<T>(t);
|
||||
return s.str();
|
||||
}
|
||||
|
||||
template <class... T>
|
||||
std::vector<std::string> toStringVector(T&&... args)
|
||||
{
|
||||
std::vector<std::string> res { toString(std::forward<T>(args))... };
|
||||
return res;
|
||||
}
|
||||
|
||||
private:
|
||||
friend class Query;
|
||||
friend class ResourceRecord;
|
||||
|
||||
private:
|
||||
std::shared_ptr<NameImpl> m_pNameImpl;
|
||||
};
|
||||
|
||||
} // namespace Dns
|
||||
} // namespace Network
|
||||
|
||||
#endif // NAME_H
|
||||
#ifndef NAME_H
|
||||
#define NAME_H
|
||||
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace Network {
|
||||
namespace Dns {
|
||||
|
||||
class NameImpl;
|
||||
|
||||
class Name
|
||||
{
|
||||
public:
|
||||
Name();
|
||||
|
||||
template<typename ...Args>
|
||||
Name(const Args& ...args) :
|
||||
Name(toStringVector(args...))
|
||||
{
|
||||
}
|
||||
|
||||
Name(const std::vector<std::string>& labels);
|
||||
|
||||
std::string GetFirstLabel() const;
|
||||
std::string GetName() const;
|
||||
bool empty() const;
|
||||
bool endsWith(const Name& suffix) const;
|
||||
|
||||
void append(const std::string& label);
|
||||
void prepend(const std::string& label);
|
||||
|
||||
void swap(Name& x) noexcept;
|
||||
|
||||
bool operator==(const Name& name) const;
|
||||
bool operator!=(const Name& name) const;
|
||||
bool operator<(const Name& name) const;
|
||||
|
||||
private:
|
||||
Name(std::shared_ptr<NameImpl> pNameImpl);
|
||||
NameImpl* PImpl() const;
|
||||
|
||||
private:
|
||||
template <class T>
|
||||
std::string toString(T&& t)
|
||||
{
|
||||
std::stringstream s;
|
||||
s << std::forward<T>(t);
|
||||
return s.str();
|
||||
}
|
||||
|
||||
template <class... T>
|
||||
std::vector<std::string> toStringVector(T&&... args)
|
||||
{
|
||||
std::vector<std::string> res { toString(std::forward<T>(args))... };
|
||||
return res;
|
||||
}
|
||||
|
||||
private:
|
||||
friend class Query;
|
||||
friend class ResourceRecord;
|
||||
|
||||
private:
|
||||
std::shared_ptr<NameImpl> m_pNameImpl;
|
||||
};
|
||||
|
||||
} // namespace Dns
|
||||
} // namespace Network
|
||||
|
||||
#endif // NAME_H
|
||||
|
||||
+43
-43
@@ -1,43 +1,43 @@
|
||||
#ifndef QUERY_H
|
||||
#define QUERY_H
|
||||
|
||||
#include "Name.h"
|
||||
#include "QueryClass.h"
|
||||
#include "QueryType.h"
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace Network {
|
||||
namespace Dns {
|
||||
|
||||
class QueryImpl;
|
||||
|
||||
class Query
|
||||
{
|
||||
public:
|
||||
Query();
|
||||
|
||||
bool GetUnicast() const;
|
||||
QueryType::type GetType() const;
|
||||
QueryClass::type GetClass() const;
|
||||
Name GetName() const;
|
||||
|
||||
void SetUnicast(bool unicast);
|
||||
void SetType(QueryType::type type);
|
||||
void SetClass(QueryClass::type class_);
|
||||
void SetName(const Name& name);
|
||||
|
||||
private:
|
||||
QueryImpl* PImpl() const;
|
||||
|
||||
private:
|
||||
friend class MulticastDnsClient;
|
||||
|
||||
private:
|
||||
std::shared_ptr<QueryImpl> m_pQueryImpl;
|
||||
};
|
||||
|
||||
} // namespace Dns
|
||||
} // namespace Network
|
||||
|
||||
#endif // QUERY_H
|
||||
#ifndef QUERY_H
|
||||
#define QUERY_H
|
||||
|
||||
#include "Name.h"
|
||||
#include "QueryClass.h"
|
||||
#include "QueryType.h"
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace Network {
|
||||
namespace Dns {
|
||||
|
||||
class QueryImpl;
|
||||
|
||||
class Query
|
||||
{
|
||||
public:
|
||||
Query();
|
||||
|
||||
bool GetUnicast() const;
|
||||
QueryType::type GetType() const;
|
||||
QueryClass::type GetClass() const;
|
||||
Name GetName() const;
|
||||
|
||||
void SetUnicast(bool unicast);
|
||||
void SetType(QueryType::type type);
|
||||
void SetClass(QueryClass::type class_);
|
||||
void SetName(const Name& name);
|
||||
|
||||
private:
|
||||
QueryImpl* PImpl() const;
|
||||
|
||||
private:
|
||||
friend class MulticastDnsClient;
|
||||
|
||||
private:
|
||||
std::shared_ptr<QueryImpl> m_pQueryImpl;
|
||||
};
|
||||
|
||||
} // namespace Dns
|
||||
} // namespace Network
|
||||
|
||||
#endif // QUERY_H
|
||||
|
||||
+25
-25
@@ -1,25 +1,25 @@
|
||||
#ifndef QUERYCLASS_H
|
||||
#define QUERYCLASS_H
|
||||
|
||||
|
||||
namespace Network {
|
||||
namespace Dns {
|
||||
|
||||
class QueryClass
|
||||
{
|
||||
public:
|
||||
enum type
|
||||
{
|
||||
NONE = 0,
|
||||
IN = 1,
|
||||
CS = 2,
|
||||
CH = 3,
|
||||
HS = 4,
|
||||
ANY = 255
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace Dns
|
||||
} // namespace Network
|
||||
|
||||
#endif // QUERYCLASS_H
|
||||
#ifndef QUERYCLASS_H
|
||||
#define QUERYCLASS_H
|
||||
|
||||
|
||||
namespace Network {
|
||||
namespace Dns {
|
||||
|
||||
class QueryClass
|
||||
{
|
||||
public:
|
||||
enum type
|
||||
{
|
||||
NONE = 0,
|
||||
IN = 1,
|
||||
CS = 2,
|
||||
CH = 3,
|
||||
HS = 4,
|
||||
ANY = 255
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace Dns
|
||||
} // namespace Network
|
||||
|
||||
#endif // QUERYCLASS_H
|
||||
|
||||
+40
-40
@@ -1,40 +1,40 @@
|
||||
#ifndef QUERYTYPE_H
|
||||
#define QUERYTYPE_H
|
||||
|
||||
|
||||
namespace Network {
|
||||
namespace Dns {
|
||||
|
||||
class QueryType
|
||||
{
|
||||
public:
|
||||
enum type
|
||||
{
|
||||
NONE = 0,
|
||||
A = 1,
|
||||
NC = 2,
|
||||
MD = 3,
|
||||
MF = 4,
|
||||
CNAME = 5,
|
||||
SOA = 6,
|
||||
MB = 7,
|
||||
MG = 8,
|
||||
MR = 9,
|
||||
NULL_ = 10,
|
||||
WKS = 11,
|
||||
PTR = 12,
|
||||
HINFO = 13,
|
||||
MINFO = 14,
|
||||
MX = 15,
|
||||
TXT = 16,
|
||||
AXFR = 252,
|
||||
MAILB = 253,
|
||||
MAILA = 254,
|
||||
ANY = 255
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace Dns
|
||||
} // namespace Network
|
||||
|
||||
#endif // QUERYTYPE_H
|
||||
#ifndef QUERYTYPE_H
|
||||
#define QUERYTYPE_H
|
||||
|
||||
|
||||
namespace Network {
|
||||
namespace Dns {
|
||||
|
||||
class QueryType
|
||||
{
|
||||
public:
|
||||
enum type
|
||||
{
|
||||
NONE = 0,
|
||||
A = 1,
|
||||
NC = 2,
|
||||
MD = 3,
|
||||
MF = 4,
|
||||
CNAME = 5,
|
||||
SOA = 6,
|
||||
MB = 7,
|
||||
MG = 8,
|
||||
MR = 9,
|
||||
NULL_ = 10,
|
||||
WKS = 11,
|
||||
PTR = 12,
|
||||
HINFO = 13,
|
||||
MINFO = 14,
|
||||
MX = 15,
|
||||
TXT = 16,
|
||||
AXFR = 252,
|
||||
MAILB = 253,
|
||||
MAILA = 254,
|
||||
ANY = 255
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace Dns
|
||||
} // namespace Network
|
||||
|
||||
#endif // QUERYTYPE_H
|
||||
|
||||
@@ -1,44 +1,44 @@
|
||||
#ifndef RESOURCERECORD_H
|
||||
#define RESOURCERECORD_H
|
||||
|
||||
#include "Class.h"
|
||||
#include "Name.h"
|
||||
#include "Type.h"
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace Network {
|
||||
namespace Dns {
|
||||
|
||||
class ResourceRecordImpl;
|
||||
|
||||
class ResourceRecord
|
||||
{
|
||||
public:
|
||||
Name GetName() const;
|
||||
Type::type GetType() const;
|
||||
Class::type GetClass() const;
|
||||
uint32_t GetTTL() const;
|
||||
|
||||
std::vector<uint8_t> GetResourceData() const;
|
||||
std::vector<uint8_t> GetData() const;
|
||||
|
||||
void SetName(const Name& name);
|
||||
void SetType(Type::type type);
|
||||
void SetClass(Class::type class_);
|
||||
void SetTTL(uint32_t ttl);
|
||||
|
||||
private:
|
||||
ResourceRecord(std::shared_ptr<ResourceRecordImpl> pResourceRecordImpl);
|
||||
|
||||
private:
|
||||
friend class MulticastDnsClient;
|
||||
|
||||
private:
|
||||
std::shared_ptr<ResourceRecordImpl> m_pResourceRecordImpl;
|
||||
};
|
||||
|
||||
} // namespace Dns
|
||||
} // namespace Network
|
||||
|
||||
#endif // RESOURCERECORD_H
|
||||
#ifndef RESOURCERECORD_H
|
||||
#define RESOURCERECORD_H
|
||||
|
||||
#include "Class.h"
|
||||
#include "Name.h"
|
||||
#include "Type.h"
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace Network {
|
||||
namespace Dns {
|
||||
|
||||
class ResourceRecordImpl;
|
||||
|
||||
class ResourceRecord
|
||||
{
|
||||
public:
|
||||
Name GetName() const;
|
||||
Type::type GetType() const;
|
||||
Class::type GetClass() const;
|
||||
uint32_t GetTTL() const;
|
||||
|
||||
std::vector<uint8_t> GetResourceData() const;
|
||||
std::vector<uint8_t> GetData() const;
|
||||
|
||||
void SetName(const Name& name);
|
||||
void SetType(Type::type type);
|
||||
void SetClass(Class::type class_);
|
||||
void SetTTL(uint32_t ttl);
|
||||
|
||||
private:
|
||||
ResourceRecord(std::shared_ptr<ResourceRecordImpl> pResourceRecordImpl);
|
||||
|
||||
private:
|
||||
friend class MulticastDnsClient;
|
||||
|
||||
private:
|
||||
std::shared_ptr<ResourceRecordImpl> m_pResourceRecordImpl;
|
||||
};
|
||||
|
||||
} // namespace Dns
|
||||
} // namespace Network
|
||||
|
||||
#endif // RESOURCERECORD_H
|
||||
|
||||
+36
-36
@@ -1,36 +1,36 @@
|
||||
#ifndef TYPE_H
|
||||
#define TYPE_H
|
||||
|
||||
|
||||
namespace Network {
|
||||
namespace Dns {
|
||||
|
||||
class Type
|
||||
{
|
||||
public:
|
||||
enum type
|
||||
{
|
||||
NONE = 0,
|
||||
A = 1,
|
||||
NC = 2,
|
||||
MD = 3,
|
||||
MF = 4,
|
||||
CNAME = 5,
|
||||
SOA = 6,
|
||||
MB = 7,
|
||||
MG = 8,
|
||||
MR = 9,
|
||||
NULL_ = 10,
|
||||
WKS = 11,
|
||||
PTR = 12,
|
||||
HINFO = 13,
|
||||
MINFO = 14,
|
||||
MX = 15,
|
||||
TXT = 16
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace Dns
|
||||
} // namespace Network
|
||||
|
||||
#endif // TYPE_H
|
||||
#ifndef TYPE_H
|
||||
#define TYPE_H
|
||||
|
||||
|
||||
namespace Network {
|
||||
namespace Dns {
|
||||
|
||||
class Type
|
||||
{
|
||||
public:
|
||||
enum type
|
||||
{
|
||||
NONE = 0,
|
||||
A = 1,
|
||||
NC = 2,
|
||||
MD = 3,
|
||||
MF = 4,
|
||||
CNAME = 5,
|
||||
SOA = 6,
|
||||
MB = 7,
|
||||
MG = 8,
|
||||
MR = 9,
|
||||
NULL_ = 10,
|
||||
WKS = 11,
|
||||
PTR = 12,
|
||||
HINFO = 13,
|
||||
MINFO = 14,
|
||||
MX = 15,
|
||||
TXT = 16
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace Dns
|
||||
} // namespace Network
|
||||
|
||||
#endif // TYPE_H
|
||||
|
||||
Reference in New Issue
Block a user