Changeset 5c3223f in rtems-libbsd


Ignore:
Timestamp:
Nov 16, 2016, 3:29:17 PM (3 years ago)
Author:
Christian Mauderer <Christian.Mauderer@…>
Branches:
fd86c091b97759106da7355ce1dd81ebe030e285, f020f08430150c1656a0ad0a1de13699db9b980b
Children:
e9a8b5a
Parents:
2389539
git-author:
Christian Mauderer <Christian.Mauderer@…> (11/16/16 15:29:17)
git-committer:
Christian Mauderer <Christian.Mauderer@…> (01/17/17 11:50:58)
Message:

ifconfig/wlan, expat, lib80211: Port to RTEMS.

Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • builder.py

    r2389539 r5c3223f  
    177177            '-Ifreebsd/sys/net',
    178178            '-Ifreebsd/include',
     179            '-Ifreebsd/lib',
    179180            '-Ifreebsd/lib/libc/include',
    180181            '-Ifreebsd/lib/libc/isc/include',
     
    184185            '-Ifreebsd/lib/libmemstat',
    185186            '-Ifreebsd/lib/libipsec',
     187            '-Ifreebsd/contrib/expat/lib',
    186188            '-Ifreebsd/contrib/libpcap',
    187189            '-Ifreebsd/contrib/libxo',
  • freebsd/lib/lib80211/lib80211_regdomain.c

    r2389539 r5c3223f  
    2929#endif /* not lint */
    3030
     31#ifdef __rtems__
     32/* We need some functions from kernel name space */
     33#define sbuf_bcat       _bsd_sbuf_bcat
     34#define sbuf_finish     _bsd_sbuf_finish
     35#define sbuf_data       _bsd_sbuf_data
     36#define sbuf_len        _bsd_sbuf_len
     37#define sbuf_delete     _bsd_sbuf_delete
     38#define sbuf_new        _bsd_sbuf_new
     39#endif /* __rtems__ */
    3140#include <sys/types.h>
    3241#include <rtems/bsd/sys/errno.h>
  • freebsd/sbin/ifconfig/ifconfig.c

    r2389539 r5c3223f  
    383383        group_ctor();
    384384        ifmedia_ctor();
     385        ieee80211_ctor();
    385386        inet6_ctor();
    386387        inet_ctor();
  • freebsd/sbin/ifconfig/ifieee80211.c

    r2389539 r5c3223f  
    11#include <machine/rtems-bsd-user-space.h>
     2
     3#ifdef __rtems__
     4#include "rtems-bsd-ifconfig-namespace.h"
     5#endif /* __rtems__ */
    26
    37/*
     
    6064 */
    6165
     66#ifdef __rtems__
     67#include <machine/rtems-bsd-program.h>
     68#endif /* __rtems__ */
    6269#include <rtems/bsd/sys/param.h>
    6370#include <sys/ioctl.h>
     
    96103#include <lib80211/lib80211_regdomain.h>
    97104#include <lib80211/lib80211_ioctl.h>
     105#ifdef __rtems__
     106#include "rtems-bsd-ifconfig-ifieee80211-data.h"
     107#endif /* __rtems__ */
    98108
    99109#ifndef IEEE80211_FIXED_RATE_NONE
     
    34493459list_scan(int s)
    34503460{
     3461#ifndef __rtems__
    34513462        uint8_t buf[24*1024];
     3463#else /* __rtems__ */
     3464        static uint8_t buf[24*1024];
     3465#endif /* __rtems__ */
    34523466        char ssid[IEEE80211_NWID_LEN+1];
    34533467        const uint8_t *cp;
     
    56945708};
    56955709
     5710#ifndef __rtems__
    56965711static __constructor void
     5712#else /* __rtems__ */
     5713void
     5714#endif /* __rtems__ */
    56975715ieee80211_ctor(void)
    56985716{
  • freebsd/sbin/ifconfig/rtems-bsd-ifconfig-data.h

    r2389539 r5c3223f  
    88/* ifclone.c */
    99/* ifconfig.c */
    10 RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, extern int setaddr);
    1110RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, extern struct ifreq ifr);
    1211RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, extern char name[16]);
    1312RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, extern char *descr);
    1413RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, extern size_t descrlen);
     14RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, extern int setaddr);
    1515RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, extern int setmask);
    1616RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, extern int doalias);
     
    2929/* ifgre.c */
    3030/* ifgroup.c */
     31/* ifieee80211.c */
    3132/* iflagg.c */
    3233RTEMS_LINKER_RWSET_CONTENT(bsd_prog_ifconfig, extern char lacpbuf[120]);
  • freebsd/sbin/ifconfig/rtems-bsd-ifconfig-namespace.h

    r2389539 r5c3223f  
    1616#define clone_setdefcallback _bsd_ifconfig_clone_setdefcallback
    1717/* ifconfig.c */
    18 #define setaddr _bsd_ifconfig_setaddr
    1918#define ifr _bsd_ifconfig_ifr
    2019#define name _bsd_ifconfig_name
    2120#define descr _bsd_ifconfig_descr
    2221#define descrlen _bsd_ifconfig_descrlen
     22#define setaddr _bsd_ifconfig_setaddr
    2323#define setmask _bsd_ifconfig_setmask
    2424#define doalias _bsd_ifconfig_doalias
     
    5050/* ifgroup.c */
    5151#define group_ctor _bsd_ifconfig_group_ctor
     52/* ifieee80211.c */
     53#define ieee80211_ctor _bsd_ifconfig_ieee80211_ctor
    5254/* iflagg.c */
    5355#define lacpbuf _bsd_ifconfig_lacpbuf
  • libbsd.py

    r2389539 r5c3223f  
    19461946            'include/rpcsvc/yp_prot.h',
    19471947            'include/sysexits.h',
     1948            'lib/lib80211/lib80211_ioctl.h',
     1949            'lib/lib80211/lib80211_regdomain.h',
    19481950            'lib/libc/db/btree/btree.h',
    19491951            'lib/libc/db/btree/extern.h',
     
    20412043            'contrib/libxo/libxo/libxo.c',
    20422044            'contrib/libxo/libxo/xo_encoder.c',
     2045            'lib/lib80211/lib80211_ioctl.c',
     2046            'lib/lib80211/lib80211_regdomain.c',
    20432047            'lib/libc/gen/err.c',
    20442048            'lib/libc/gen/feature_present.c',
     
    22212225            'sbin/ifconfig/ifgre.c',
    22222226            'sbin/ifconfig/ifgroup.c',
     2227            'sbin/ifconfig/ifieee80211.c',
    22232228            'sbin/ifconfig/iflagg.c',
    22242229            'sbin/ifconfig/ifmac.c',
     
    22592264        ],
    22602265        mm.generator['source'](['-DINET6', '-DINET'])
     2266    )
     2267    return mod
     2268
     2269#
     2270# Contrib expat
     2271#
     2272def contrib_expat(mm):
     2273    mod = builder.Module('contrib_expat')
     2274    cflags = ['-DHAVE_MEMMOVE=1']
     2275    mod.addRTEMSHeaderFiles(
     2276        [
     2277            'include/bsdxml.h',
     2278        ]
     2279    )
     2280    mod.addUserSpaceHeaderFiles(
     2281        [
     2282            'contrib/expat/lib/ascii.h',
     2283            'contrib/expat/lib/asciitab.h',
     2284            'contrib/expat/lib/expat_external.h',
     2285            'contrib/expat/lib/expat.h',
     2286            'contrib/expat/lib/iasciitab.h',
     2287            'contrib/expat/lib/internal.h',
     2288            'contrib/expat/lib/latin1tab.h',
     2289            'contrib/expat/lib/nametab.h',
     2290            'contrib/expat/lib/utf8tab.h',
     2291            'contrib/expat/lib/xmlrole.h',
     2292            'contrib/expat/lib/xmltok.h',
     2293            'contrib/expat/lib/xmltok_impl.h',
     2294        ]
     2295    )
     2296    mod.addUserSpaceSourceFiles(
     2297        [
     2298            'contrib/expat/lib/xmlparse.c',
     2299            'contrib/expat/lib/xmlrole.c',
     2300            'contrib/expat/lib/xmltok.c',
     2301            'contrib/expat/lib/xmltok_impl.c',
     2302            'contrib/expat/lib/xmltok_ns.c',
     2303        ],
     2304        mm.generator['source'](cflags)
    22612305    )
    22622306    return mod
     
    28312875
    28322876    mm.addModule(user_space(mm))
     2877    mm.addModule(contrib_expat(mm))
    28332878    mm.addModule(contrib_libpcap(mm))
    28342879    mm.addModule(usr_sbin_tcpdump(mm))
  • libbsd_waf.py

    r2389539 r5c3223f  
    6767    includes += ["freebsd/sys/net"]
    6868    includes += ["freebsd/include"]
     69    includes += ["freebsd/lib"]
    6970    includes += ["freebsd/lib/libc/include"]
    7071    includes += ["freebsd/lib/libc/isc/include"]
     
    7475    includes += ["freebsd/lib/libmemstat"]
    7576    includes += ["freebsd/lib/libipsec"]
     77    includes += ["freebsd/contrib/expat/lib"]
    7678    includes += ["freebsd/contrib/libpcap"]
    7779    includes += ["freebsd/contrib/libxo"]
     
    231233
    232234    # Objects built with different CFLAGS
    233     objs01_source = ['freebsd/bin/hostname/hostname.c',
     235    objs01_source = ['freebsd/contrib/expat/lib/xmlparse.c',
     236                     'freebsd/contrib/expat/lib/xmlrole.c',
     237                     'freebsd/contrib/expat/lib/xmltok.c',
     238                     'freebsd/contrib/expat/lib/xmltok_impl.c',
     239                     'freebsd/contrib/expat/lib/xmltok_ns.c']
     240    bld.objects(target = "objs01",
     241                features = "c",
     242                cflags = cflags,
     243                includes = [] + includes,
     244                defines = defines + ['HAVE_MEMMOVE=1'],
     245                source = objs01_source)
     246    libbsd_use += ["objs01"]
     247
     248    objs02_source = ['freebsd/bin/hostname/hostname.c',
    234249                     'freebsd/contrib/libxo/libxo/libxo.c',
    235250                     'freebsd/contrib/libxo/libxo/xo_encoder.c',
     251                     'freebsd/lib/lib80211/lib80211_ioctl.c',
     252                     'freebsd/lib/lib80211/lib80211_regdomain.c',
    236253                     'freebsd/lib/libc/gen/err.c',
    237254                     'freebsd/lib/libc/gen/feature_present.c',
     
    414431                     'freebsd/sbin/ifconfig/ifgre.c',
    415432                     'freebsd/sbin/ifconfig/ifgroup.c',
     433                     'freebsd/sbin/ifconfig/ifieee80211.c',
    416434                     'freebsd/sbin/ifconfig/iflagg.c',
    417435                     'freebsd/sbin/ifconfig/ifmac.c',
     
    450468                     'freebsd/usr.bin/vmstat/vmstat.c',
    451469                     'freebsd/usr.sbin/arp/arp.c']
    452     bld.objects(target = "objs01",
     470    bld.objects(target = "objs02",
    453471                features = "c",
    454472                cflags = cflags,
    455473                includes = [] + includes,
    456474                defines = defines + ['INET', 'INET6'],
    457                 source = objs01_source)
    458     libbsd_use += ["objs01"]
    459 
    460     objs02_source = ['rtemsbsd/mghttpd/mongoose.c']
    461     bld.objects(target = "objs02",
     475                source = objs02_source)
     476    libbsd_use += ["objs02"]
     477
     478    objs03_source = ['rtemsbsd/mghttpd/mongoose.c']
     479    bld.objects(target = "objs03",
    462480                features = "c",
    463481                cflags = cflags,
    464482                includes = [] + includes,
    465483                defines = defines + ['NO_CGI', 'NO_POPEN', 'NO_SSL', 'USE_WEBSOCKET'],
    466                 source = objs02_source)
    467     libbsd_use += ["objs02"]
    468 
    469     objs03_source = ['freebsd/lib/libc/db/btree/bt_close.c',
     484                source = objs03_source)
     485    libbsd_use += ["objs03"]
     486
     487    objs04_source = ['freebsd/lib/libc/db/btree/bt_close.c',
    470488                     'freebsd/lib/libc/db/btree/bt_conv.c',
    471489                     'freebsd/lib/libc/db/btree/bt_debug.c',
     
    491509                     'freebsd/lib/libc/db/recno/rec_seq.c',
    492510                     'freebsd/lib/libc/db/recno/rec_utils.c']
    493     bld.objects(target = "objs03",
     511    bld.objects(target = "objs04",
    494512                features = "c",
    495513                cflags = cflags,
    496514                includes = [] + includes,
    497515                defines = defines + ['INET6', '__DBINTERFACE_PRIVATE'],
    498                 source = objs03_source)
    499     libbsd_use += ["objs03"]
    500 
    501     objs04_source = ['dhcpcd/arp.c',
     516                source = objs04_source)
     517    libbsd_use += ["objs04"]
     518
     519    objs05_source = ['dhcpcd/arp.c',
    502520                     'dhcpcd/auth.c',
    503521                     'dhcpcd/bpf.c',
     
    521539                     'dhcpcd/net.c',
    522540                     'dhcpcd/platform-bsd.c']
    523     bld.objects(target = "objs04",
     541    bld.objects(target = "objs05",
    524542                features = "c",
    525543                cflags = cflags,
    526544                includes = [] + includes,
    527545                defines = defines + ['INET', 'INET6', 'MASTER_ONLY', 'THERE_IS_NO_FORK', '__FreeBSD__'],
    528                 source = objs04_source)
    529     libbsd_use += ["objs04"]
    530 
    531     objs05_source = ['freebsd/contrib/libpcap/bpf_image.c',
     546                source = objs05_source)
     547    libbsd_use += ["objs05"]
     548
     549    objs06_source = ['freebsd/contrib/libpcap/bpf_image.c',
    532550                     'freebsd/contrib/libpcap/etherent.c',
    533551                     'freebsd/contrib/libpcap/fad-getad.c',
     
    542560                     'freebsd/contrib/libpcap/sf-pcap-ng.c',
    543561                     'freebsd/contrib/libpcap/sf-pcap.c']
    544     bld.objects(target = "objs05",
     562    bld.objects(target = "objs06",
    545563                features = "c",
    546564                cflags = cflags,
    547565                includes = [] + includes,
    548566                defines = defines + ['BSD=1', 'HAVE_INTTYPES=1', 'HAVE_LIMITS_H=1', 'HAVE_NET_IF_MEDIA_H=1', 'HAVE_SNPRINTF=1', 'HAVE_SOCKADDR_SA_LEN=1', 'HAVE_STDINT=1', 'HAVE_STRERROR=1', 'HAVE_STRLCPY=1', 'HAVE_SYS_IOCCOM_H=1', 'HAVE_VSNPRINTF=1', 'INET6', '_U_=__attribute__((unused))', '__FreeBSD__=1'],
    549                 source = objs05_source)
    550     libbsd_use += ["objs05"]
    551 
    552     objs06_source = ['freebsd/contrib/tcpdump/addrtoname.c',
     567                source = objs06_source)
     568    libbsd_use += ["objs06"]
     569
     570    objs07_source = ['freebsd/contrib/tcpdump/addrtoname.c',
    553571                     'freebsd/contrib/tcpdump/af.c',
    554572                     'freebsd/contrib/tcpdump/bpf_dump.c',
     
    693711                     'freebsd/contrib/tcpdump/tcpdump.c',
    694712                     'freebsd/contrib/tcpdump/util.c']
    695     bld.objects(target = "objs06",
     713    bld.objects(target = "objs07",
    696714                features = "c",
    697715                cflags = cflags,
    698716                includes = ['freebsd/contrib/tcpdump', 'freebsd/usr.sbin/tcpdump/tcpdump'] + includes,
    699717                defines = defines + ['HAVE_CONFIG_H=1', 'HAVE_NET_PFVAR_H=1', 'INET6', '_U_=__attribute__((unused))', '__FreeBSD__=1'],
    700                 source = objs06_source)
    701     libbsd_use += ["objs06"]
     718                source = objs07_source)
     719    libbsd_use += ["objs07"]
    702720
    703721    source = ['freebsd/sys/arm/xilinx/zy7_slcr.c',
Note: See TracChangeset for help on using the changeset viewer.