Changeset 573b4cd6 in rtems-libbsd for rtemsbsd/pppd


Ignore:
Timestamp:
10/08/14 06:04:59 (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, 5-freebsd-12, 6-freebsd-12, freebsd-9.3, master
Children:
403d0b8
Parents:
70fa95a
git-author:
Sebastian Huber <sebastian.huber@…> (10/08/14 06:04:59)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/08/14 13:03:29)
Message:

ppp: Port to new stack

Location:
rtemsbsd/pppd
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • rtemsbsd/pppd/ipcp.c

    r70fa95a r573b4cd6  
    3838#include "ipcp.h"
    3939#include "pathnames.h"
    40 
    41 #include <rtems/bsdnet/servers.h>
    4240
    4341static const char rcsid[] = RCSID;
     
    15781576    uint32_t peerdns1, uint32_t peerdns2)
    15791577{
    1580   /* initialize values */
    1581   rtems_bsdnet_nameserver_count = 0;
    1582 
    1583   /* check to see if primary was specified */
    1584   if ( peerdns1 ) {
    1585     rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count].s_addr = peerdns1;
    1586     rtems_bsdnet_nameserver_count++;
    1587   }
    1588 
    1589   /* check to see if secondary was specified */
    1590   if ( peerdns2 ) {
    1591     rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count].s_addr = peerdns2;
    1592     rtems_bsdnet_nameserver_count++;
    1593   }
    1594 
    1595   /* initialize resolver */
    1596   __res_init();
     1578    FILE *f;
     1579
     1580    f = fopen(_PATH_RESOLV, "w");
     1581    if (f == NULL) {
     1582        error("Failed to create %s: %m", _PATH_RESOLV);
     1583        return;
     1584    }
     1585
     1586    if (peerdns1)
     1587        fprintf(f, "nameserver %s\n", ip_ntoa(peerdns1));
     1588
     1589    if (peerdns2)
     1590        fprintf(f, "nameserver %s\n", ip_ntoa(peerdns2));
     1591
     1592    if (ferror(f))
     1593        error("Write failed to %s: %m", _PATH_RESOLV);
     1594
     1595    fclose(f);
    15971596}
    15981597
  • rtemsbsd/pppd/pathnames.h

    r70fa95a r573b4cd6  
    2929#define _PATH_CONNERRS   _ROOT_PATH "/etc/ppp/connect-errors"
    3030#define _PATH_PEERFILES  _ROOT_PATH "/etc/ppp/peers/"
    31 #define _PATH_RESOLV     _ROOT_PATH "/etc/ppp/resolv.conf"
     31#define _PATH_RESOLV     _ROOT_PATH "/etc/resolv.conf"
    3232
    3333#define _PATH_USEROPT    ".ppprc"
  • rtemsbsd/pppd/pppd.h

    r70fa95a r573b4cd6  
    3232#include <rtems/rtemsdialer.h>
    3333#include <stdint.h>
     34#include <arpa/nameser.h>
     35#include <arpa/nameser_compat.h>
    3436
    3537#if defined(__STDC__)
     
    4648#include "eui64.h"
    4749#endif
     50
     51#include "namespace.h"
    4852
    4953/*
     
    503507}
    504508
    505 
    506 #define GETSHORT(s, cp) { \
    507         (s) = *(cp)++ << 8; \
    508         (s) |= *(cp)++; \
    509 }
    510 #define PUTSHORT(s, cp) { \
    511         *(cp)++ = (u_char) ((s) >> 8); \
    512         *(cp)++ = (u_char) (s); \
    513 }
    514 
    515 #define GETLONG(l, cp) { \
    516         (l) = *(cp)++ << 8; \
    517         (l) |= *(cp)++; (l) <<= 8; \
    518         (l) |= *(cp)++; (l) <<= 8; \
    519         (l) |= *(cp)++; \
    520 }
    521 #define PUTLONG(l, cp) { \
    522         *(cp)++ = (u_char) ((l) >> 24); \
    523         *(cp)++ = (u_char) ((l) >> 16); \
    524         *(cp)++ = (u_char) ((l) >> 8); \
    525         *(cp)++ = (u_char) (l); \
    526 }
    527 
    528509#define INCPTR(n, cp)   ((cp) += (n))
    529510#define DECPTR(n, cp)   ((cp) -= (n))
  • rtemsbsd/pppd/rtemsmain.c

    r70fa95a r573b4cd6  
    4242#include <rtems.h>
    4343#include <rtems/rtems_bsdnet.h>
     44#include <rtems/rtemsdialer.h>
    4445
    4546#include "pppd.h"
     
    5657#include "pathnames.h"
    5758#include "patchlevel.h"
    58 #include "rtemsdialer.h"
    5959
    6060#ifdef CBCP_SUPPORT
  • rtemsbsd/pppd/rtemspppd.c

    r70fa95a r573b4cd6  
    1111 */
    1212
     13#include <rtems/rtemspppd.h>
    1314#include <rtems.h>
    14 #include <rtems/rtems_bsdnet.h>
    1515#include "pppd.h"
    16 #include "rtemspppd.h"
    1716
    1817
     
    8382  rtems_name          taskName;
    8483
    85   /* determine priority value */
    86   if ( rtems_bsdnet_config.network_task_priority ) {
    87     priority = rtems_bsdnet_config.network_task_priority;
    88   }
    89 
    9084  /* initialize the exit hook */
    9185  rtems_pppd_exitfp = (rtems_pppd_hookfunction)0;
  • rtemsbsd/pppd/sys-rtems.c

    r70fa95a r573b4cd6  
    6060#include <rtems/rtems_bsdnet.h>
    6161#include <rtems/termiostypes.h>
    62 extern int      rtems_bsdnet_microseconds_per_tick;
    6362extern rtems_id rtems_pppd_taskid;
    6463
     
    501500
    502501  /* recommended delay to help negotiation */
    503   ticks = 300000/rtems_bsdnet_microseconds_per_tick;
     502  ticks = 300000/rtems_configuration_get_microseconds_per_tick();
    504503  rtems_task_wake_after(ticks);
    505504}
     
    523522    else {
    524523      ticks = (timo->tv_sec * 1000000 + timo->tv_usec) /
    525         rtems_bsdnet_microseconds_per_tick;
     524        rtems_configuration_get_microseconds_per_tick();
    526525      if(ticks <= 0)
    527526        ticks = 1;
Note: See TracChangeset for help on using the changeset viewer.