STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
sntp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007-2009 Fr�d�ric Bernon, Simon Goldschmidt
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without modification,
6  * are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  * 3. The name of the author may not be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
19  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
21  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
24  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
25  * OF SUCH DAMAGE.
26  *
27  * This file is part of the lwIP TCP/IP stack.
28  *
29  * Author: Fr�d�ric Bernon, Simon Goldschmidt
30  *
31  */
32 #ifndef LWIP_HDR_APPS_SNTP_H
33 #define LWIP_HDR_APPS_SNTP_H
34 
35 #include "lwip/apps/sntp_opts.h"
36 #include "lwip/ip_addr.h"
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /* SNTP operating modes: default is to poll using unicast.
43  The mode has to be set before calling sntp_init(). */
44 #define SNTP_OPMODE_POLL 0
45 #define SNTP_OPMODE_LISTENONLY 1
46 void sntp_setoperatingmode(u8_t operating_mode);
48 
49 void sntp_init(void);
50 void sntp_stop(void);
51 
52 void sntp_setserver(u8_t idx, const ip_addr_t *addr);
54 
55 #if SNTP_SERVER_DNS
56 void sntp_setservername(u8_t idx, char *server);
57 char *sntp_getservername(u8_t idx);
58 #endif /* SNTP_SERVER_DNS */
59 
60 #if SNTP_GET_SERVERS_FROM_DHCP
61 void sntp_servermode_dhcp(int set_servers_from_dhcp);
62 #else /* SNTP_GET_SERVERS_FROM_DHCP */
63 #define sntp_servermode_dhcp(x)
64 #endif /* SNTP_GET_SERVERS_FROM_DHCP */
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif /* LWIP_HDR_APPS_SNTP_H */
uint32_t idx
Definition: lcd_log.c:247
ip_addr_t sntp_getserver(u8_t idx)
void sntp_setserver(u8_t idx, const ip_addr_t *addr)
void sntp_init(void)
#define sntp_servermode_dhcp(x)
Definition: sntp.h:63
void sntp_setoperatingmode(u8_t operating_mode)
void sntp_stop(void)
unsigned char u8_t
Definition: cc.h:38
ip6_addr_t ip_addr_t
Definition: ip_addr.h:194
u8_t sntp_getoperatingmode(void)