MeterLogger
|
#include <esp8266.h>
#include <lwip/ip.h>
#include <lwip/udp.h>
#include <lwip/tcp_impl.h>
#include <netif/etharp.h>
#include <lwip/netif.h>
#include <lwip/lwip_napt.h>
#include <lwip/dns.h>
#include <lwip/app/dhcpserver.h>
#include <lwip/opt.h>
#include <espconn.h>
Go to the source code of this file.
Macros | |
#define | DNS_LEN 512 |
#define | FLAG_QR (1<<7) |
#define | FLAG_AA (1<<2) |
#define | FLAG_TC (1<<1) |
#define | FLAG_RD (1<<0) |
#define | QTYPE_A 1 |
#define | QTYPE_NS 2 |
#define | QTYPE_CNAME 5 |
#define | QTYPE_SOA 6 |
#define | QTYPE_WKS 11 |
#define | QTYPE_PTR 12 |
#define | QTYPE_HINFO 13 |
#define | QTYPE_MINFO 14 |
#define | QTYPE_MX 15 |
#define | QTYPE_TXT 16 |
#define | QTYPE_URI 256 |
#define | QCLASS_IN 1 |
#define | QCLASS_ANY 255 |
#define | QCLASS_URI 256 |
Functions | |
struct | __attribute__ ((packed)) |
static void ICACHE_FLASH_ATTR | setn16 (void *pp, int16_t n) |
static void ICACHE_FLASH_ATTR | setn32 (void *pp, int32_t n) |
static uint16_t ICACHE_FLASH_ATTR | my_ntohs (uint16_t *in) |
static char *ICACHE_FLASH_ATTR | labelToStr (char *packet, char *labelPtr, int packetSz, char *res, int resMaxLen) |
static char ICACHE_FLASH_ATTR * | strToLabel (char *str, char *label, int maxLen) |
static void ICACHE_FLASH_ATTR | captdnsRecv (void *arg, char *pusrdata, unsigned short length) |
void ICACHE_FLASH_ATTR | captdnsInit (void) |
void ICACHE_FLASH_ATTR | captdnsStop (void) |
Variables | |
static struct espconn | conn |
DnsHeader | |
DnsLabel | |
DnsQuestionFooter | |
DnsResourceFooter | |
DnsUriHdr | |
#define DNS_LEN 512 |
Definition at line 47 of file captdns.c.
Referenced by captdnsRecv().
#define FLAG_QR (1<<7) |
Definition at line 92 of file captdns.c.
Referenced by captdnsRecv().
#define FLAG_TC (1<<1) |
Definition at line 94 of file captdns.c.
Referenced by captdnsRecv().
#define QCLASS_IN 1 |
Definition at line 109 of file captdns.c.
Referenced by captdnsRecv().
#define QCLASS_URI 256 |
Definition at line 111 of file captdns.c.
Referenced by captdnsRecv().
#define QTYPE_A 1 |
Definition at line 97 of file captdns.c.
Referenced by captdnsRecv().
#define QTYPE_NS 2 |
Definition at line 98 of file captdns.c.
Referenced by captdnsRecv().
#define QTYPE_URI 256 |
Definition at line 107 of file captdns.c.
Referenced by captdnsRecv().
struct __attribute__ | ( | (packed) | ) |
Definition at line 53 of file captdns.c.
Referenced by espconn_sendto().
void ICACHE_FLASH_ATTR captdnsInit | ( | void | ) |
Definition at line 344 of file captdns.c.
References captdnsRecv(), espconn_create(), espconn_regist_recvcb(), ESPCONN_UDP, _esp_udp::local_port, espconn::proto, espconn::type, and espconn::udp.
Referenced by captdnsRecv().
|
static |
Definition at line 192 of file captdns.c.
References captdnsInit(), conn, DNS_LEN, DnsHeader, DnsQuestionFooter, DnsResourceFooter, DnsUriHdr, espconn_get_connection_info(), ESPCONN_OK, espconn_sendto(), FLAG_QR, FLAG_TC, htons, ICACHE_FLASH_ATTR, INADDR_ANY, ip_info::ip, ip4_addr1, ip4_addr2, ip4_addr3, ip4_addr4, labelToStr(), memcpy, memset, my_ntohs(), NULL, espconn::proto, QCLASS_IN, QCLASS_URI, QTYPE_A, QTYPE_NS, QTYPE_URI, _esp_udp::remote_ip, _remot_info::remote_ip, _esp_udp::remote_port, _remot_info::remote_port, setn16(), setn32(), SOFTAP_IF, strToLabel(), espconn::udp, and wifi_get_ip_info().
Referenced by captdnsInit().
void ICACHE_FLASH_ATTR captdnsStop | ( | void | ) |
Definition at line 353 of file captdns.c.
References espconn_delete().
|
static |
Definition at line 138 of file captdns.c.
References my_ntohs(), and NULL.
Referenced by captdnsRecv().
|
static |
Definition at line 130 of file captdns.c.
Referenced by captdnsRecv(), and labelToStr().
|
static |
Definition at line 115 of file captdns.c.
Referenced by captdnsRecv().
|
static |
Definition at line 122 of file captdns.c.
Referenced by captdnsRecv().
|
static |
Definition at line 170 of file captdns.c.
Referenced by captdnsRecv().
|
static |
Definition at line 50 of file captdns.c.
Referenced by captdnsRecv(), httpdConnectCb(), httpdDisconCb(), httpdFindConnData(), httpdReconCb(), httpdRecvCb(), and httpdSentCb().
DnsHeader |
Definition at line 61 of file captdns.c.
Referenced by captdnsRecv().
DnsQuestionFooter |
Definition at line 74 of file captdns.c.
Referenced by captdnsRecv().
DnsResourceFooter |
Definition at line 84 of file captdns.c.
Referenced by captdnsRecv().
DnsUriHdr |
Definition at line 89 of file captdns.c.
Referenced by captdnsRecv().