lwip-1.4.1 (partial)
dns-server/dnserver.h@1:119c4f7144c8, 2018-07-24 (annotated)
- Committer:
- ua1arn
- Date:
- Tue Jul 24 17:36:01 2018 +0000
- Revision:
- 1:119c4f7144c8
lwip 1.4.1 with necessary servers
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ua1arn | 1:119c4f7144c8 | 1 | /* |
ua1arn | 1:119c4f7144c8 | 2 | * The MIT License (MIT) |
ua1arn | 1:119c4f7144c8 | 3 | * |
ua1arn | 1:119c4f7144c8 | 4 | * Copyright (c) 2015 by Sergey Fetisov <fsenok@gmail.com> |
ua1arn | 1:119c4f7144c8 | 5 | * |
ua1arn | 1:119c4f7144c8 | 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
ua1arn | 1:119c4f7144c8 | 7 | * of this software and associated documentation files (the "Software"), to deal |
ua1arn | 1:119c4f7144c8 | 8 | * in the Software without restriction, including without limitation the rights |
ua1arn | 1:119c4f7144c8 | 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
ua1arn | 1:119c4f7144c8 | 10 | * copies of the Software, and to permit persons to whom the Software is |
ua1arn | 1:119c4f7144c8 | 11 | * furnished to do so, subject to the following conditions: |
ua1arn | 1:119c4f7144c8 | 12 | * |
ua1arn | 1:119c4f7144c8 | 13 | * The above copyright notice and this permission notice shall be included in all |
ua1arn | 1:119c4f7144c8 | 14 | * copies or substantial portions of the Software. |
ua1arn | 1:119c4f7144c8 | 15 | * |
ua1arn | 1:119c4f7144c8 | 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
ua1arn | 1:119c4f7144c8 | 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
ua1arn | 1:119c4f7144c8 | 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
ua1arn | 1:119c4f7144c8 | 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
ua1arn | 1:119c4f7144c8 | 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
ua1arn | 1:119c4f7144c8 | 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
ua1arn | 1:119c4f7144c8 | 22 | * SOFTWARE. |
ua1arn | 1:119c4f7144c8 | 23 | */ |
ua1arn | 1:119c4f7144c8 | 24 | |
ua1arn | 1:119c4f7144c8 | 25 | /* |
ua1arn | 1:119c4f7144c8 | 26 | * version: 1.0 demo (7.02.2015) |
ua1arn | 1:119c4f7144c8 | 27 | * brief: tiny dns ipv4 server using lwip (pcb) |
ua1arn | 1:119c4f7144c8 | 28 | */ |
ua1arn | 1:119c4f7144c8 | 29 | |
ua1arn | 1:119c4f7144c8 | 30 | #ifndef DNSERVER |
ua1arn | 1:119c4f7144c8 | 31 | #define DNSERVER |
ua1arn | 1:119c4f7144c8 | 32 | |
ua1arn | 1:119c4f7144c8 | 33 | #include <stdint.h> |
ua1arn | 1:119c4f7144c8 | 34 | #include <stdbool.h> |
ua1arn | 1:119c4f7144c8 | 35 | #include <stdio.h> |
ua1arn | 1:119c4f7144c8 | 36 | #include <string.h> |
ua1arn | 1:119c4f7144c8 | 37 | #include "lwip/def.h" |
ua1arn | 1:119c4f7144c8 | 38 | #include "lwip/err.h" |
ua1arn | 1:119c4f7144c8 | 39 | #include "lwip/udp.h" |
ua1arn | 1:119c4f7144c8 | 40 | #include "netif/etharp.h" |
ua1arn | 1:119c4f7144c8 | 41 | |
ua1arn | 1:119c4f7144c8 | 42 | typedef bool (*dns_query_proc_t)(const char *name, ip_addr_t *addr); |
ua1arn | 1:119c4f7144c8 | 43 | |
ua1arn | 1:119c4f7144c8 | 44 | err_t dnserv_init(ip_addr_t *bind, uint16_t port, dns_query_proc_t query_proc); |
ua1arn | 1:119c4f7144c8 | 45 | void dnserv_free(void); |
ua1arn | 1:119c4f7144c8 | 46 | |
ua1arn | 1:119c4f7144c8 | 47 | #endif |