2011-03-20 18:18:19 +00:00
|
|
|
/****************************************************************************
|
2021-06-16 09:22:16 +02:00
|
|
|
* apps/examples/nettest/nettest.h
|
2011-03-20 18:18:19 +00:00
|
|
|
*
|
2021-06-15 09:09:58 +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
|
2011-03-20 18:18:19 +00:00
|
|
|
*
|
2021-06-15 09:09:58 +02:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2011-03-20 18:18:19 +00:00
|
|
|
*
|
2021-06-15 09:09:58 +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.
|
2011-03-20 18:18:19 +00:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __EXAMPLES_NETTEST_H
|
|
|
|
#define __EXAMPLES_NETTEST_H
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
2014-07-04 19:13:08 -06:00
|
|
|
#include <arpa/inet.h>
|
|
|
|
|
2013-01-24 16:28:15 +00:00
|
|
|
#ifdef NETTEST_HOST
|
2011-03-20 18:18:19 +00:00
|
|
|
#else
|
|
|
|
# include <debug.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
2015-01-20 18:12:27 -06:00
|
|
|
* Pre-processor Definitions
|
2011-03-20 18:18:19 +00:00
|
|
|
****************************************************************************/
|
|
|
|
|
2013-01-24 16:28:15 +00:00
|
|
|
#ifdef NETTEST_HOST
|
2011-03-20 18:18:19 +00:00
|
|
|
/* HTONS/L macros are unique to uIP */
|
|
|
|
|
2020-02-05 00:30:34 +09:00
|
|
|
# undef HTONS
|
|
|
|
# undef HTONL
|
2011-03-20 18:18:19 +00:00
|
|
|
# define HTONS(a) htons(a)
|
|
|
|
# define HTONL(a) htonl(a)
|
|
|
|
|
|
|
|
/* Have SO_LINGER */
|
|
|
|
|
|
|
|
# define NETTEST_HAVE_SOLINGER 1
|
|
|
|
|
|
|
|
#else
|
2014-10-08 08:33:00 -06:00
|
|
|
# ifdef CONFIG_NET_SOLINGER
|
|
|
|
# define NETTEST_HAVE_SOLINGER 1
|
2011-03-20 18:18:19 +00:00
|
|
|
# else
|
2014-10-08 08:33:00 -06:00
|
|
|
# undef NETTEST_HAVE_SOLINGER
|
2011-03-20 18:18:19 +00:00
|
|
|
# endif
|
2015-01-20 18:12:27 -06:00
|
|
|
#endif /* NETTEST_HOST */
|
|
|
|
|
|
|
|
#ifdef CONFIG_EXAMPLES_NETTEST_IPv6
|
|
|
|
# define AF_INETX AF_INET6
|
|
|
|
# define PF_INETX PF_INET6
|
|
|
|
#else
|
|
|
|
# define AF_INETX AF_INET
|
|
|
|
# define PF_INETX PF_INET
|
2011-03-20 18:18:19 +00:00
|
|
|
#endif
|
|
|
|
|
2017-06-23 12:21:13 -06:00
|
|
|
#ifndef CONFIG_EXAMPLES_NETTEST_SERVER_PORTNO
|
|
|
|
# define CONFIG_EXAMPLES_NETTEST_SERVER_PORTNO 5471
|
|
|
|
#endif
|
|
|
|
|
2017-06-24 09:49:44 -06:00
|
|
|
#ifdef CONFIG_EXAMPLES_NETTEST_SENDSIZE
|
|
|
|
# define SENDSIZE CONFIG_EXAMPLES_NETTEST_SENDSIZE
|
|
|
|
#else
|
|
|
|
# define SENDSIZE 4096
|
|
|
|
#endif
|
2011-03-20 18:18:19 +00:00
|
|
|
|
2017-06-23 12:21:13 -06:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_EXAMPLES_NETTEST_IPv6
|
2020-02-05 00:26:47 +09:00
|
|
|
extern uint16_t g_nettestserver_ipv6[8];
|
2017-06-23 12:21:13 -06:00
|
|
|
#else
|
2020-02-05 00:26:47 +09:00
|
|
|
extern uint32_t g_nettestserver_ipv4;
|
2017-06-23 12:21:13 -06:00
|
|
|
#endif
|
|
|
|
|
2011-03-20 18:18:19 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
2017-06-23 11:40:02 -06:00
|
|
|
#ifdef CONFIG_EXAMPLES_NETTEST_INIT
|
|
|
|
void nettest_initialize(void);
|
|
|
|
#endif
|
|
|
|
|
2017-06-25 09:15:27 -06:00
|
|
|
void nettest_cmdline(int argc, char **argv);
|
|
|
|
extern void nettest_client(void);
|
|
|
|
extern void nettest_server(void);
|
2011-03-20 18:18:19 +00:00
|
|
|
|
|
|
|
#endif /* __EXAMPLES_NETTEST_H */
|