2015-09-03 02:18:47 +02:00
|
|
|
/****************************************************************************
|
2021-06-16 09:22:16 +02:00
|
|
|
* apps/examples/netloop/netloop.h
|
2015-09-03 02:18:47 +02: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
|
2015-09-03 02:18:47 +02:00
|
|
|
*
|
2021-06-15 09:09:58 +02:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2015-09-03 02:18:47 +02: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.
|
2015-09-03 02:18:47 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __APPS_EXAMPLES_NETLOOP_NETLOOP_H
|
|
|
|
#define __APPS_EXAMPLES_NETLOOP_NETLOOP_H
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Compilation Switches
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <pthread.h>
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Pre-processor Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* Here are all of the configuration settings that must be met to have TCP/IP
|
|
|
|
* poll/select support. This kind of looks like overkill.
|
|
|
|
*
|
|
|
|
* CONFIG_NET - Network support must be enabled
|
|
|
|
* CONFIG_NET_TCP - Only support on TCP (because read-ahead
|
|
|
|
* buffering s not yet support for UDP)
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2019-02-11 23:23:55 +01:00
|
|
|
#ifndef CONFIG_NET
|
2015-09-03 02:18:47 +02:00
|
|
|
# error Network socket support not enabled
|
|
|
|
#endif
|
|
|
|
|
2020-01-15 14:48:38 +01:00
|
|
|
#if !defined(CONFIG_NET_TCP) || !defined(CONFIG_NET_TCPBACKLOG) || \
|
|
|
|
!defined(CONFIG_NET_TCP_WRITE_BUFFERS)
|
2015-09-03 02:18:47 +02:00
|
|
|
# error TCP not configured correctly
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(CONFIG_NET_IPv4)
|
|
|
|
# error This test only works with IPv4
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define LISTENER_DELAY 3 /* 3 seconds */
|
|
|
|
#define LISTENER_PORT 5471
|
|
|
|
#define LO_ADDRESS 0x7f000001
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Types
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
2016-02-22 01:15:00 +01:00
|
|
|
* Public Data
|
2015-09-03 02:18:47 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
void *lo_listener(pthread_addr_t pvarg);
|
|
|
|
|
|
|
|
#endif /* __APPS_EXAMPLES_NETLOOP_NETLOOP_H */
|