Changeset 4c02385 in rtems


Ignore:
Timestamp:
Jun 24, 2016, 6:52:48 AM (3 years ago)
Author:
Christian Mauderer <Christian.Mauderer@…>
Branches:
master
Children:
f0fc2c0
Parents:
657e6c93
git-author:
Christian Mauderer <Christian.Mauderer@…> (06/24/16 06:52:48)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/28/16 11:10:01)
Message:

libnetworking: Import current <arpa/inet.h>

Import the <arpa/inet.h> from current FreeBSD. Necessary due to changes
in <netinet/in.h>. Remove BSD hack from <arpa/inet.h>.

Clean up problems with htonl(). These functions are defined in
<arpa/inet.h>. This lead to some problems because they are defined in
<rtems/endian.h> too. Add NTOHL, ... to
<rtems/rtems_bsdnet_internal.h>.

Files:
16 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/atsam/network/if_atsam.c

    r657e6c93 r4c02385  
    5959#include <netinet/in.h>
    6060#include <netinet/if_ether.h>
    61 
    62 #include <arpa/inet.h>
    6361
    6462#include <dev/mii/mii.h>
  • c/src/lib/libbsp/m68k/csb360/network/network.c

    r657e6c93 r4c02385  
    3939#include <sys/types.h>
    4040#include <sys/socket.h>
    41 #include <arpa/inet.h>
    4241
    4342/*
  • c/src/lib/libbsp/m68k/mvme167/network/network.c

    r657e6c93 r4c02385  
    6767#include <netinet/in.h>
    6868#include <netinet/if_ether.h>
    69 #include <arpa/inet.h>
    7069
    7170#include "uti596.h"
  • c/src/lib/libbsp/powerpc/beatnik/network/porting/if_xxx_rtems.c

    r657e6c93 r4c02385  
    2828#include <netinet/in.h>
    2929#include <netinet/if_ether.h>
    30 #include <arpa/inet.h>
    3130
    3231#include <net/if_media.h>
  • c/src/lib/libbsp/powerpc/haleakala/network/network.c

    r657e6c93 r4c02385  
    3535#include <sys/types.h>
    3636#include <sys/socket.h>
    37 #include <arpa/inet.h>
    3837
    3938#include <ppc4xx/ppc405gp.h>
  • c/src/lib/libbsp/powerpc/tqm8xx/network/network_fec.c

    r657e6c93 r4c02385  
    6868#include <sys/types.h>
    6969#include <sys/socket.h>
    70 #include <arpa/inet.h>
    7170
    7271/*
  • c/src/lib/libbsp/powerpc/tqm8xx/network/network_scc.c

    r657e6c93 r4c02385  
    6464#include <sys/types.h>
    6565#include <sys/socket.h>
    66 #include <arpa/inet.h>
    6766
    6867/*
  • cpukit/libnetworking/arpa/inet.h

    r657e6c93 r4c02385  
    5252/*%
    5353 *      @(#)inet.h      8.1 (Berkeley) 6/2/93
    54  * $FreeBSD: src/include/arpa/inet.h,v 1.33 2010/07/06 03:48:46 maxim Exp $
     54 *      $Id: inet.h,v 1.3 2005/04/27 04:56:16 sra Exp $
     55 * $FreeBSD: head/include/arpa/inet.h 269867 2014-08-12 12:36:06Z ume $
    5556 */
    56 
    5757
    5858#ifndef _ARPA_INET_H_
     
    6262
    6363#include <sys/cdefs.h>
    64 #include <rtems/bsdnet/_types.h>
     64#include <sys/_types.h>
    6565
    6666/* Required for byteorder(3) functions. */
    67 #include <rtems/endian.h>
     67#include <machine/endian.h>
    6868
    6969#define INET_ADDRSTRLEN         16
    7070#define INET6_ADDRSTRLEN        46
     71
     72#ifndef _UINT16_T_DECLARED
     73typedef __uint16_t      uint16_t;
     74#define _UINT16_T_DECLARED
     75#endif
     76
     77#ifndef _UINT32_T_DECLARED
     78typedef __uint32_t      uint32_t;
     79#define _UINT32_T_DECLARED
     80#endif
    7181
    7282#ifndef _IN_ADDR_T_DECLARED
     
    7888typedef uint16_t        in_port_t;
    7989#define _IN_PORT_T_DECLARED
     90#endif
     91
     92#if __BSD_VISIBLE
     93#ifndef _SIZE_T_DECLARED
     94typedef __size_t        size_t;
     95#define _SIZE_T_DECLARED
     96#endif
    8097#endif
    8198
     
    96113#endif
    97114
    98 #if !defined(__rtems__) /* RTEMS -- Why rename these? */
    99 /* XXX all new diversions!! argh!! */
    100 #if __BSD_VISIBLE
    101 #define inet_addr               __inet_addr
    102 #define inet_aton               __inet_aton
    103 #define inet_lnaof              __inet_lnaof
    104 #define inet_makeaddr           __inet_makeaddr
    105 #define inet_neta               __inet_neta
    106 #define inet_netof              __inet_netof
    107 #define inet_network            __inet_network
    108 #define inet_net_ntop           __inet_net_ntop
    109 #define inet_net_pton           __inet_net_pton
    110 #define inet_cidr_ntop          __inet_cidr_ntop
    111 #define inet_cidr_pton          __inet_cidr_pton
    112 #define inet_ntoa               __inet_ntoa
    113 #define inet_ntoa_r             __inet_ntoa_r
    114 #define inet_pton               __inet_pton
    115 #define inet_ntop               __inet_ntop
    116 #define inet_nsap_addr          __inet_nsap_addr
    117 #define inet_nsap_ntoa          __inet_nsap_ntoa
    118 #endif /* __BSD_VISIBLE */
    119 #endif /* __rtems__ */
     115__BEGIN_DECLS
     116#ifndef _BYTEORDER_PROTOTYPED
     117#define _BYTEORDER_PROTOTYPED
     118uint32_t         htonl(uint32_t);
     119uint16_t         htons(uint16_t);
     120uint32_t         ntohl(uint32_t);
     121uint16_t         ntohs(uint16_t);
     122#endif
    120123
    121 __BEGIN_DECLS
    122124in_addr_t        inet_addr(const char *);
    123 char            *inet_ntoa(struct in_addr);
     125/*const*/ char  *inet_ntoa(struct in_addr);
    124126const char      *inet_ntop(int, const void * __restrict, char * __restrict,
    125127                    socklen_t);
     
    135137char            *inet_net_ntop(int, const void *, int, char *, size_t);
    136138int              inet_net_pton(int, const char *, void *, size_t);
     139char            *inet_ntoa_r(struct in_addr, char *buf, socklen_t size);
     140char            *inet_cidr_ntop(int, const void *, int, char *, size_t);
     141int              inet_cidr_pton(int, const char *, void *, int *);
    137142unsigned         inet_nsap_addr(const char *, unsigned char *, int);
    138143char            *inet_nsap_ntoa(int, const unsigned char *, char *);
     
    140145__END_DECLS
    141146
     147#ifndef _BYTEORDER_FUNC_DEFINED
     148#define _BYTEORDER_FUNC_DEFINED
     149#define htonl(x)        __htonl(x)
     150#define htons(x)        __htons(x)
     151#define ntohl(x)        __ntohl(x)
     152#define ntohs(x)        __ntohs(x)
     153#endif
     154
    142155#endif /* !_ARPA_INET_H_ */
     156
     157/*! \file */
  • cpukit/libnetworking/arpa/nameser_compat.h

    r657e6c93 r4c02385  
    4141#define __BIND          19950621        /* (DEAD) interface version stamp. */
    4242
    43 #include <rtems/endian.h>
     43#include <sys/endian.h>
    4444
    4545#if !defined(BYTE_ORDER) || \
  • cpukit/libnetworking/rtems/mkrootfs.c

    r657e6c93 r4c02385  
    3737#include <sys/socket.h>
    3838#include <netinet/in.h>
    39 #include <arpa/inet.h>
    4039
    4140#include <rtems/mkrootfs.h>
    4241#include <rtems/libio.h>
     42#include <rtems/endian.h>
    4343
    4444/*
  • cpukit/libnetworking/rtems/mkrootfs.h

    r657e6c93 r4c02385  
    2222#define _RTEMS_MKROOTFS_H
    2323
    24 #include <arpa/inet.h> /* in_addr_t */
     24#include <sys/types.h> /* in_addr_t */
    2525
    2626#include <rtems.h>
  • cpukit/libnetworking/rtems/rtems_bsdnet_internal.h

    r657e6c93 r4c02385  
    3232#include <machine/types.h>
    3333#include <machine/param.h>
     34#include <machine/endian.h>
    3435#include <sys/cdefs.h>
    3536
     
    106107#endif
    107108
    108 #include <rtems/endian.h>
     109#ifndef _BYTEORDER_PROTOTYPED
     110#define _BYTEORDER_PROTOTYPED
     111__BEGIN_DECLS
     112__uint32_t       htonl(__uint32_t);
     113__uint16_t       htons(__uint16_t);
     114__uint32_t       ntohl(__uint32_t);
     115__uint16_t       ntohs(__uint16_t);
     116__END_DECLS
     117#endif
     118
     119#ifndef _BYTEORDER_FUNC_DEFINED
     120#define _BYTEORDER_FUNC_DEFINED
     121#define htonl(x)        __htonl(x)
     122#define htons(x)        __htons(x)
     123#define ntohl(x)        __ntohl(x)
     124#define ntohs(x)        __ntohs(x)
     125#endif /* !_BYTEORDER_FUNC_DEFINED */
     126
     127#define NTOHS(x) (x) = ntohs(x)
     128#define HTONS(x) (x) = htons(x)
     129#define NTOHL(x) (x) = ntohl(x)
     130#define HTONL(x) (x) = htonl(x)
     131
     132in_addr_t        inet_addr(const char *);
    109133
    110134typedef quad_t          rlim_t;         /* resource limit */
  • cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c

    r657e6c93 r4c02385  
    7272#include <netinet/in_var.h>     /* for in_aliasreq */
    7373#include <sys/sockio.h>         /* for ioctl definitions */
    74 #include <arpa/inet.h>          /* for inet_addr, inet_ntop */
    75 
    7674
    7775static int network_fail_timeout = RTEMS_DHCP_FAILSAFE_NETWORK_FAIL_TIMEOUT;
  • cpukit/libnetworking/rtems/rtems_glue.c

    r657e6c93 r4c02385  
    3131#include <netinet/in.h>
    3232#include <vm/vm.h>
    33 #include <arpa/inet.h>
    3433
    3534#include <net/netisr.h>
     
    830829 * IP header checksum routine for processors which don't have an inline version
    831830 */
     831
     832struct ip;
    832833
    833834u_int in_cksum_hdr(const struct ip *);
  • cpukit/libnetworking/rtems/rtems_showifstat.c

    r657e6c93 r4c02385  
    1616#include <net/if_types.h>
    1717#include <netinet/in.h>
    18 #include <arpa/inet.h>
    1918
    2019#include <rtems/rtems_bsdnet.h>
  • cpukit/libnetworking/rtems/rtems_showroute.c

    r657e6c93 r4c02385  
    1919
    2020#include <netinet/in.h>
    21 
    22 #include <arpa/inet.h>
    2321
    2422/*
Note: See TracChangeset for help on using the changeset viewer.