summaryrefslogtreecommitdiffstats
path: root/testsuites/samples/pppd
diff options
context:
space:
mode:
authorVijay Kumar Banerjee <vijay@rtems.org>2021-02-26 16:19:20 -0700
committerVijay Kumar Banerjee <vijay@rtems.org>2021-04-07 16:15:39 -0600
commitdf6d765c3aa13d7f83b602127cb9aa97c592c7cf (patch)
tree48b19f766610da7ca99bd40920f816fb1a4a0215 /testsuites/samples/pppd
parentspec: Remove residue bsps spec files (diff)
downloadrtems-df6d765c3aa13d7f83b602127cb9aa97c592c7cf.tar.bz2
testsuites: Remove all legacy networking tests
Update #3850
Diffstat (limited to 'testsuites/samples/pppd')
-rw-r--r--testsuites/samples/pppd/README11
-rw-r--r--testsuites/samples/pppd/init.c61
-rw-r--r--testsuites/samples/pppd/netconfig.h33
-rw-r--r--testsuites/samples/pppd/ppp.conf27
-rw-r--r--testsuites/samples/pppd/pppd.options9
-rw-r--r--testsuites/samples/pppd/pppdapp.c152
-rw-r--r--testsuites/samples/pppd/system.h50
7 files changed, 0 insertions, 343 deletions
diff --git a/testsuites/samples/pppd/README b/testsuites/samples/pppd/README
deleted file mode 100644
index 49fb2be770..0000000000
--- a/testsuites/samples/pppd/README
+++ /dev/null
@@ -1,11 +0,0 @@
-This is an example user application using pppd. It is built using
-the RTEMS application Makefiles. The file Makefile-user should
-be renamed to Makefile or the -f option given to make. The file
-is renamed to avoid bootstrap -c removing it.
-
-The files ppp.conf and pppd.options are sample configuration files
-that have successfully used to make ppp connections over a null
-modem serial cable to a UNIX box. Please review the man pages
-for either the ppp or pppd applications to ensure they are configured
-correctly.
-
diff --git a/testsuites/samples/pppd/init.c b/testsuites/samples/pppd/init.c
deleted file mode 100644
index 95e0d533f4..0000000000
--- a/testsuites/samples/pppd/init.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-2012.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define CONFIGURE_INIT
-#include "system.h"
-
-#include <rtems/rtems_bsdnet.h>
-#include <rtems/rtemspppd.h>
-#include <rtems/shell.h>
-#include "netconfig.h"
-#include <tmacros.h>
-
-const char rtems_test_name[] = "PPPD";
-
-static void notification(int fd, int seconds_remaining, void *arg)
-{
- printf(
- "Press any key to start pppd (%is remaining)\n",
- seconds_remaining
- );
-}
-
-rtems_task Init(rtems_task_argument argument)
-{
- rtems_status_code status;
-
- rtems_print_printer_fprintf_putc(&rtems_test_printer);
-
- TEST_BEGIN();
-
- status = rtems_shell_wait_for_input(
- STDIN_FILENO,
- 10,
- notification,
- NULL
- );
- if (status != RTEMS_SUCCESSFUL) {
- TEST_END();
- exit( 0 );
- }
-
- /* initialize network */
- rtems_bsdnet_initialize_network();
- rtems_pppd_initialize();
- pppdapp_initialize();
- rtems_task_exit();
-}
diff --git a/testsuites/samples/pppd/netconfig.h b/testsuites/samples/pppd/netconfig.h
deleted file mode 100644
index f1d6494864..0000000000
--- a/testsuites/samples/pppd/netconfig.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef NETCONFIG_H_
-#define NETCONFIG_H_
-
-#include <bsp.h>
-#include <rtems/rtemspppd.h>
-
-/* Default network interface */
-static struct rtems_bsdnet_ifconfig netdriver_config = {
- "ppp0", /* name */
- rtems_ppp_driver_attach, /* attach function */
- NULL, /* No more interfaces */
- NULL, /* IP address */
- NULL, /* IP net mask */
- NULL, /* Driver supplies hardware address */
- 0 /* Use default driver parameters */
-};
-
-/* Network configuration */
-struct rtems_bsdnet_config rtems_bsdnet_config = {
- &netdriver_config,
- NULL,
- 30, /* Default network task priority */
- (256UL *1024UL), /* Default mbuf capacity */
- (512UL *1024UL), /* Default mbuf cluster capacity */
- 0, /* Host name */
- 0, /* Domain name */
- 0, /* Gateway */
- 0, /* Log host */
- { 0 }, /* Name server(s) */
- { 0 }, /* NTP server(s) */
-};
-
-#endif
diff --git a/testsuites/samples/pppd/ppp.conf b/testsuites/samples/pppd/ppp.conf
deleted file mode 100644
index 094b1946a8..0000000000
--- a/testsuites/samples/pppd/ppp.conf
+++ /dev/null
@@ -1,27 +0,0 @@
-
-#
-# Example configuration file for setting up a ppp server
-# using a null-modem serial cable:
-#
-# Tested using ppp on OpenBSD 2.9
-# - just follow instructions in man page for accepting
-# ppp connections over the serial port
-# - if pap and/or chap is enabled, you must have a ppp.secret
-# file which will be used for user authentication
-# - found useful to turn on syslog for ppp
-#
-
-default:
- set log Phase Chat LQM LCP IPCP CCP command
- set device /dev/cua00
- set speed 57600
- set ctsrts on
- set dial ""
-
-openbsd-server:
- set timeout 0
- set ifaddr 192.168.2.100 192.168.2.123
- enable dns
- allow users
- enable chap
- enable pap
diff --git a/testsuites/samples/pppd/pppd.options b/testsuites/samples/pppd/pppd.options
deleted file mode 100644
index c0706e6ec5..0000000000
--- a/testsuites/samples/pppd/pppd.options
+++ /dev/null
@@ -1,9 +0,0 @@
-/dev/tty00
-57600
-crtscts
-passive
-local
-noauth
-debug
-persist
-192.168.2.222:192.168.2.111
diff --git a/testsuites/samples/pppd/pppdapp.c b/testsuites/samples/pppd/pppdapp.c
deleted file mode 100644
index bf8cd525cd..0000000000
--- a/testsuites/samples/pppd/pppdapp.c
+++ /dev/null
@@ -1,152 +0,0 @@
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-
-#include <bsp.h>
-
-#include <stdio.h>
-#include <rtems/rtemspppd.h>
-#include "system.h"
-
-
-/* define global variables */
-static unsigned int pppdapp_linkcount = 0;
-static rtems_id pppdapp_taskid;
-
-
-static void pppdapp_linkup_hook(void)
-{
- pppdapp_linkcount++;
- printf("PPP LINK UP [%d]\n", pppdapp_linkcount);
-}
-
-static void pppdapp_linkdown_hook(void)
-{
- printf("PPP LINK DOWN [%d]\n", pppdapp_linkcount);
-}
-
-static void pppdapp_ipup_hook(void)
-{
- /* send ipup signal to pppdapp task */
- rtems_event_send(pppdapp_taskid, RTEMS_EVENT_10);
-}
-
-static void pppdapp_ipdown_hook(void)
-{
- /* send ip down signal to pppdapp task */
- rtems_event_send(pppdapp_taskid, RTEMS_EVENT_11);
-}
-
-static void pppdapp_setup(void)
-{
- const char *pUser = "oscar";
- const char *pPassword = "goldman";
-
-#undef USE_MODEM
-#ifdef USE_MODEM
- const char *pTelephone = "5551234";
- const char *pInitScript = "TIMEOUT@5@@AT@@OK@";
- const char *pConnectScript = "TIMEOUT@90@@ATDT%s@CONNECT@@name:@%s@word:@%s@";
- const char *pDisconnectScript = "TIMEOUT@5@@ATH0@@OK@";
- char pConnect[128];
-
- /* set the connect string */
- sprintf(pConnect, pConnectScript, pTelephone, pUser, pPassword);
-
- /* set pppd options for modem */
- rtems_pppd_set_option("/dev/ttyS2", NULL);
- rtems_pppd_set_option("57600", NULL);
- rtems_pppd_set_option("crtscts", NULL);
- rtems_pppd_set_option("modem", NULL);
- rtems_pppd_set_option("noauth", NULL);
- rtems_pppd_set_option("debug", NULL);
- rtems_pppd_set_option("init", pInitScript);
- rtems_pppd_set_option("connect", pConnect);
- rtems_pppd_set_option("disconnect", pDisconnectScript);
-#else
- /* set pppd options for null modem direct link serial cable */
- rtems_pppd_set_option("/dev/ttyS1", NULL);
- rtems_pppd_set_option("57600", NULL);
- rtems_pppd_set_option("crtscts", NULL);
- rtems_pppd_set_option("local", NULL);
- rtems_pppd_set_option("noauth", NULL);
- rtems_pppd_set_option("debug", NULL);
- rtems_pppd_set_option("user", pUser);
- rtems_pppd_set_option("password", pPassword);
-#endif
-
- /* set up pppd hooks */
- rtems_pppd_set_hook(RTEMS_PPPD_LINKUP_HOOK, pppdapp_linkup_hook);
- rtems_pppd_set_hook(RTEMS_PPPD_LINKDOWN_HOOK, pppdapp_linkdown_hook);
- rtems_pppd_set_hook(RTEMS_PPPD_IPUP_HOOK, pppdapp_ipup_hook);
- rtems_pppd_set_hook(RTEMS_PPPD_IPDOWN_HOOK, pppdapp_ipdown_hook);
-}
-
-static rtems_task pppdapp(rtems_task_argument arg)
-{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
- rtems_interval tickspersecond = 0;
- rtems_option options;
- rtems_event_set in;
- rtems_event_set out;
-
- /* initialize ticks per second */
- tickspersecond = rtems_clock_get_ticks_per_second();
- if ( tickspersecond == 0 ) {
- /* ensure value is greater than zero */
- tickspersecond = 100;
- }
-
- /* initiate connection */
- pppdapp_setup();
- rtems_pppd_connect();
-
- /* enter processing loop */
- in = (RTEMS_EVENT_10 | RTEMS_EVENT_11);
- options = (RTEMS_EVENT_ANY | RTEMS_WAIT);
- while ( sc == RTEMS_SUCCESSFUL ) {
- /* wait for the next event */
- sc = rtems_event_receive(in, options, RTEMS_NO_TIMEOUT, &out);
- if ( sc == RTEMS_SUCCESSFUL ) {
- /* determine which event was sent */
- if ( out & RTEMS_EVENT_10 ) {
- /* ip up recived */
- /* call disconnect function */
- rtems_pppd_disconnect();
- }
- if ( out & RTEMS_EVENT_11 ) {
- /* ip down recived */
- /* sleep 10 seconds and call connect function */
- rtems_task_wake_after(10*tickspersecond);
- rtems_pppd_connect();
- }
- }
- }
-
- /* terminate myself */
- rtems_task_exit();
-}
-
-int pppdapp_initialize(void)
-{
- int iReturn = (int)-1;
- rtems_status_code status;
- rtems_name taskName;
-
- taskName = rtems_build_name( 'p', 'a', 'p', 'p' );
- status = rtems_task_create(taskName,
- CONFIGURE_INIT_TASK_PRIORITY,
- CONFIGURE_INIT_TASK_STACK_SIZE,
- CONFIGURE_INIT_TASK_INITIAL_MODES,
- RTEMS_DEFAULT_ATTRIBUTES,
- &pppdapp_taskid);
- if ( status == RTEMS_SUCCESSFUL ) {
- status = rtems_task_start(pppdapp_taskid, pppdapp, 0);
- if ( status == RTEMS_SUCCESSFUL ) {
- iReturn = (int)0;
- }
- }
-
- return ( iReturn );
-}
diff --git a/testsuites/samples/pppd/system.h b/testsuites/samples/pppd/system.h
deleted file mode 100644
index c9972fe9b3..0000000000
--- a/testsuites/samples/pppd/system.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef SYSTEM_H
-#define SYSTEM_H
-
-#include <rtems.h>
-#include <rtems/test-info.h>
-#include <rtems/console.h>
-#include <rtems/clockdrv.h>
-
-/* functions */
-extern rtems_task Init(rtems_task_argument argument);
-extern int pppdapp_initialize(void);
-
-#include <bsp.h>
-
-#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
-#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
-
-#ifndef TTY1_DRIVER_TABLE_ENTRY
- #define TTY1_DRIVER_TABLE_ENTRY NULL_DRIVER_TABLE_ENTRY
-#endif
-#ifndef TTY2_DRIVER_TABLE_ENTRY
- #define TTY2_DRIVER_TABLE_ENTRY NULL_DRIVER_TABLE_ENTRY
-#endif
-
-#define CONFIGURE_APPLICATION_EXTRA_DRIVERS \
- TTY1_DRIVER_TABLE_ENTRY, TTY2_DRIVER_TABLE_ENTRY
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 8
-
-#define CONFIGURE_UNIFIED_WORK_AREAS
-
-#define CONFIGURE_UNLIMITED_OBJECTS
-
-#define CONFIGURE_MICROSECONDS_PER_TICK 10000
-
-#define CONFIGURE_INIT_TASK_STACK_SIZE (10*1024)
-#define CONFIGURE_INIT_TASK_PRIORITY 120
-#define CONFIGURE_INIT_TASK_INITIAL_MODES (RTEMS_PREEMPT | \
- RTEMS_NO_TIMESLICE | \
- RTEMS_NO_ASR | \
- RTEMS_INTERRUPT_LEVEL(0))
-#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
-
-#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
-
-#include <rtems/confdefs.h>
-
-#endif