2017-05-06 19:28:56 +02:00
|
|
|
/****************************************************************************
|
2019-04-29 18:22:56 +02:00
|
|
|
* apps/include/netutils/netinit.h
|
2017-05-06 19:28:56 +02:00
|
|
|
*
|
2021-06-11 08:28:21 +02:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2017-05-06 19:28:56 +02:00
|
|
|
*
|
2021-06-11 08:28:21 +02:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2017-05-06 19:28:56 +02:00
|
|
|
*
|
2021-06-11 08:28:21 +02:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2017-05-06 19:28:56 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2019-04-29 18:22:56 +02:00
|
|
|
#ifndef __APPS_INCLUDE_NETUTILS_NETINIT_H
|
|
|
|
#define __APPS_INCLUDE_NETUTILS_NETINIT_H
|
|
|
|
|
2017-05-06 19:28:56 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
2019-04-29 18:22:56 +02:00
|
|
|
#ifdef CONFIG_NETUTILS_NETINIT
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Pre-processor Definitions
|
|
|
|
****************************************************************************/
|
2019-04-29 19:49:15 +02:00
|
|
|
|
2019-04-29 18:22:56 +02:00
|
|
|
/* Configuration ************************************************************/
|
|
|
|
|
|
|
|
/* Networking support. Make sure that all non-boolean configuration
|
|
|
|
* settings have some value.
|
|
|
|
*/
|
2017-05-06 19:28:56 +02:00
|
|
|
|
2019-04-29 18:22:56 +02:00
|
|
|
#ifndef CONFIG_NETINIT_IPADDR
|
|
|
|
# define CONFIG_NETINIT_IPADDR 0x0a000002
|
|
|
|
#endif
|
2017-05-06 19:28:56 +02:00
|
|
|
|
2019-04-29 18:22:56 +02:00
|
|
|
#ifndef CONFIG_NETINIT_DRIPADDR
|
|
|
|
# define CONFIG_NETINIT_DRIPADDR 0x0a000001
|
|
|
|
#endif
|
2017-05-06 19:28:56 +02:00
|
|
|
|
2019-04-29 18:22:56 +02:00
|
|
|
#ifndef CONFIG_NETINIT_NETMASK
|
|
|
|
# define CONFIG_NETINIT_NETMASK 0xffffff00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CONFIG_NETINIT_DNSIPADDR
|
|
|
|
# define CONFIG_NETINIT_DNSIPADDR CONFIG_NETINIT_DRIPADDR
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CONFIG_NETINIT_MACADDR
|
|
|
|
# define CONFIG_NETINIT_MACADDR 0x00e0deadbeef
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(CONFIG_NETINIT_THREAD) || !defined(CONFIG_ARCH_PHY_INTERRUPT) || \
|
2019-04-29 22:53:38 +02:00
|
|
|
!defined(CONFIG_NETDEV_PHY_IOCTL) || !defined(CONFIG_NET_UDP)
|
2019-04-29 18:22:56 +02:00
|
|
|
# undef CONFIG_NETINIT_MONITOR
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CONFIG_NETINIT_RETRYMSEC
|
|
|
|
# define CONFIG_NETINIT_RETRYMSEC 2000
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CONFIG_NETINIT_SIGNO
|
2023-03-25 00:07:59 +01:00
|
|
|
# define CONFIG_NETINIT_SIGNO 32
|
2019-04-29 18:22:56 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CONFIG_NETINIT_THREAD_STACKSIZE
|
|
|
|
# define CONFIG_NETINIT_THREAD_STACKSIZE 1568
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CONFIG_NETINIT_THREAD_PRIORITY
|
|
|
|
# define CONFIG_NETINIT_THREAD_PRIORITY 100
|
|
|
|
#endif
|
2017-05-06 19:28:56 +02:00
|
|
|
|
|
|
|
/****************************************************************************
|
2019-04-29 18:22:56 +02:00
|
|
|
* Public Function Prototypes
|
2017-05-06 19:28:56 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
2019-04-29 19:49:15 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
#define EXTERN extern "C"
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#else
|
|
|
|
#define EXTERN extern
|
|
|
|
#endif
|
|
|
|
|
2017-05-06 19:28:56 +02:00
|
|
|
/****************************************************************************
|
2019-04-29 18:22:56 +02:00
|
|
|
* Name: netinit_bringup
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Initialize the network per the selected NuttX configuration
|
|
|
|
*
|
2017-05-06 19:28:56 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
2019-04-29 18:22:56 +02:00
|
|
|
int netinit_bringup(void);
|
2017-05-06 19:28:56 +02:00
|
|
|
|
2019-04-29 18:22:56 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: netinit_associate
|
|
|
|
****************************************************************************/
|
2017-05-06 19:28:56 +02:00
|
|
|
|
2019-04-29 18:22:56 +02:00
|
|
|
#ifdef CONFIG_WIRELESS_WAPI
|
|
|
|
int netinit_associate(FAR const char *ifname);
|
|
|
|
#endif
|
2017-05-06 19:28:56 +02:00
|
|
|
|
2019-04-29 19:49:15 +02:00
|
|
|
#undef EXTERN
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2019-04-29 18:22:56 +02:00
|
|
|
#endif /* CONFIG_NETUTILS_NETINIT */
|
|
|
|
#endif /* __APPS_INCLUDE_NETUTILS_NETINIT_H */
|