51 lines
948 B
C++
51 lines
948 B
C++
#pragma once
|
|
|
|
#ifndef LWE_IPV4_HEADER
|
|
#define LWE_IPV4_HEADER 60
|
|
#endif
|
|
|
|
#ifndef LWE_IPV6_HEADER
|
|
#define LWE_IPV6_HEADER 40
|
|
#endif
|
|
|
|
#ifndef LWE_UDP_HEADER
|
|
#define LWE_UDP_HEADER 8
|
|
#endif
|
|
|
|
#ifndef LWE_IPV4_UDP_PAYLOAD
|
|
#define LWE_IPV4_UDP_PAYLOAD (LWE_UINT_16_MAX - LWE_IPV4_HEADER - LWE_UDP_HEADER)
|
|
#endif
|
|
|
|
#ifndef LWE_IPV6_UDP_PAYLOAD
|
|
#define LWE_IPV6_UDP_PAYLOAD (LWE_UINT_16_MAX - LWE_IPV6_HEADER - LWE_UDP_HEADER)
|
|
#endif
|
|
|
|
namespace lwe
|
|
{
|
|
enum class AddrType
|
|
{
|
|
IPV6,
|
|
IPV4
|
|
};
|
|
|
|
enum class ContentType
|
|
{
|
|
APP_MULTIPART_FORMDATA,
|
|
APP_FORMURLENCODED,
|
|
APP_JAVASCRIPT,
|
|
APP_JSON,
|
|
APP_XML,
|
|
TEXT_PLAIN,
|
|
TEXT_HTML,
|
|
TEXT_XML,
|
|
NONE
|
|
};
|
|
|
|
#if defined(LWE_OS_WINDOWS)
|
|
typedef UInt_64 Socket;
|
|
#define LWE_INVALID_SOCKET LWE_UINT_64_MAX
|
|
#elif defined(LWE_OS_LINUX)
|
|
typedef SInt_32 Socket;
|
|
#define LWE_INVALID_SOCKET (SInt_32)0xffffffff
|
|
#endif
|
|
} |