Changeset 5ddce1f in rtems-libbsd


Ignore:
Timestamp:
Oct 22, 2013, 9:06:19 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, afaeccc05a556f6aa25ba044a7e49d6aa634a59e, freebsd-9.3, master
Children:
37b0ab6
Parents:
616f6000
git-author:
Sebastian Huber <sebastian.huber@…> (10/22/13 09:06:19)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/31/13 12:18:50)
Message:

loopback01: Initialize via IFCONFIG(8)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuite/loopback01/test_main.c

    r616f6000 r5ddce1f  
    77#include <stdio.h>
    88
     9#include <rtems/bsd/sys/param.h>
    910#include <sys/socket.h>
    1011#include <netinet/in.h>
     
    1314
    1415#include <rtems/error.h>
     16#include <assert.h>
    1517#include <stdio.h>
    1618#include <stdarg.h>
     
    2022#include <sys/socket.h>
    2123#include <netinet/in.h>
    22 
    23 /* for old configuration structure */
    24 #include <rtems/rtems_bsdnet.h>
    25 
    26 /*
    27  * Network configuration
    28  */
    29 struct rtems_bsdnet_config rtems_bsdnet_config = {
    30     NULL,                   /* Network interface */
    31     NULL,                   /* Use fixed network configuration */
    32     0,                      /* Default network task priority */
    33     0,                      /* Default mbuf capacity */
    34     0,                      /* Default mbuf cluster capacity */
    35     "testSystem",           /* Host name */
    36     "nowhere.com",          /* Domain name */
    37     "127.0.0.1",            /* Gateway */
    38     "127.0.0.1",            /* Log host */
    39     {"127.0.0.1" },         /* Name server(s) */
    40     {"127.0.0.1" },         /* NTP server(s) */
    41     0,
    42     0,
    43     0,
    44     0,
    45     0
    46 };
     24#include <sysexits.h>
     25
     26#include <machine/rtems-bsd-commands.h>
     27
     28#include <rtems.h>
    4729
    4830/*
     
    217199  rtems_status_code    sc;
    218200  rtems_task_priority  old;
     201  int                  exit_code;
     202  char *lo0[] = {
     203    "ifconfig",
     204    "lo0",
     205    "inet",
     206    "127.0.0.1",
     207    "netmask",
     208    "255.255.255.0",
     209    NULL
     210  };
    219211
    220212  sc = rtems_semaphore_create(
     
    241233  clientWorker(0);
    242234
     235  exit_code = rtems_bsd_command_ifconfig(nitems(lo0) - 1, lo0);
     236  assert(exit_code == EX_OK);
     237
    243238  printf("\nStart server.\n");
    244239  spawnTask(serverTask, 150, 0);
Note: See TracChangeset for help on using the changeset viewer.