This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Working with Jumbo Frames

Hi,

I have a query on how to check jumbo frame option enabled or not.

I compiled my NDK package (v2.21) by :

- Changing package file in stack directory @ C:\ti\ndk_2_21_01_38_Copy\packages\ti\ndk\stack

- Changing package file in netctrl directory C:\ti\ndk_2_21_01_38_Copy\packages\ti\ndk\netctrl

stack_dir_package_bld.txt
/*
 * Copyright (c) 2012, Texas Instruments Incorporated
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * *  Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * *  Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * *  Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * */
/*
 * ======== package.bld ========
 */

Pkg.otherFiles = [
    "package.bld",
    "fdt/fdt.h",
    "ip/ip.h",
    "ipv6/ipv6.h",
    "lli/lli.h",
    "nat/nat.h",
    "nat/proxy.h",
    "pbm/jumbo_pbm.c",
    "ppp/md5.h",
    "ppp/ppp.h",
    "pppoe/pppoe.h",
    "rawethsock/rawethsock.h",
    "route/route.h",
    "sock/sock.h",
    "sock6/sock6.h",
    "tcp/tcp.h",
    "tcp6/tcp6.h",
];

/* List of all the NDK core files. */
var coreLibFiles = [
    "bind/bind.c",
    "ether/ether.c",
    "ether/etherin.c",
    "fdt/file.c",
    "fdt/fileuser.c",
    "fdt/socket.c",
    "icmp/icmp.c",
    "icmp/icmpin.c",
    "igmp/igmp.c",
    "ip/ip.c",
    "ip/ipin.c",
    "ip/ipout.c",
    "ip/ipfrag.c",
    "lli/lli.c",
    "lli/lliin.c",
    "lli/lliout.c",
    "node/node.c",
    "pipe/pipe.c",
    "raw/raw.c",
    "res/exec.c",
    "res/if.c",
    "res/sb.c",
    "res/timer.c",
    "route/route.c",
    "route/rtable.c",
    "rtc/rtc.c",
    "sock/sock.c",
    "sock/sockint.c",
    "sock/sockpcb.c",
    "sock/sockprot.c",
    "tcp/tcp.c",
    "tcp/tcpin.c",
    "tcp/tcpout.c",
    "tcp/tcpprot.c",
    "tcp/tcptime.c",
    "udp/udp.c",
    "nat/nat.c",
    "nat/natpkt.c",
    "nat/proxy.c",
    "ppp/auth.c",
    "ppp/ipcp.c",
    "ppp/lcp.c",
    "ppp/md5.c",
    "ppp/ppp.c",
    "ppp/nimuppp.c",
    "pppoe/pppoe.c",
    "utils/listlib.c",
    "pppoe/nimupppoe.c",
    "nimu/nimu.c",
    "vlan/vlan.c",
    "bind6/bind6.c",
    "icmpv6/icmpv6.c",
    "icmpv6/icmpv6_ndisc.c",
    "icmpv6/icmpv6in.c",
    "icmpv6/icmpv6out.c",
    "ipv6/ipv6.c",
    "ipv6/ipv6_exthdrs.c",
    "ipv6/ipv6_frag.c",
    "ipv6/ipv6in.c",
    "ipv6/ipv6out.c",
    "lli6/lli6.c",
    "mld/mld.c",
    "raw6/raw6.c",
    "res6/sb6.c",
    "route6/route6.c",
    "sock6/sock6.c",
    "sock6/sock6int.c",
    "sock6/sock6pcb.c",
    "sock6/sock6prot.c",
    "tcp6/tcp6.c",
    "tcp6/tcp6in.c",
    "tcp6/tcp6out.c",
    "tcp6/tcp6prot.c",
    "tcp6/tcp6time.c",
    "udp6/udp6.c",
    "raweth/raweth.c",
    "rawethsock/rawethsock.c",
    "rawethsock/rawethsock_prot.c",
    "rawethsock/rawethsock_pcb.c",

    // build PBM into stack library to allow pure IPv4 libs (SDOCM00076155)
    "pbm/pbm.c",
    "pbm/pbm_data.c",

    /*
     * Jumbo frame support
     *
     * To add support for jumbo frames, add the following file to this array
     * and throw the following define to the compiler in 'copts' below:
     *
     *    -D_INCLUDE_JUMBOFRAME_SUPPORT
     */
     "pbm/jumbo_pbm.c",
];

/*
 *       M3 Library Build Options
 *
 * NOTE: currently only IPv4 M3 libraries have reduced sizes.
 *
 * Building for M3 requires reduced values for the following sizes,
 * normally defined in pbm.c and mem_bios6.c:
 *
 *     PKT_NUM_FRAMEBUF
 *     PKT_SIZE_FRAMEBUF
 *
 * By defining _NDK_MIN_PBM_BUFS, this allows
 * these sizes to be redefined elsewhere.  For M3, we'll redefine
 * them here, in the compiler options variable 'copts', then pass this for all
 * IPv4 library versions for M3:
 */
var m3PbmCopts = " -D_NDK_MIN_PBM_BUFS" +
                 " -DPKT_NUM_FRAMEBUF=16" +
                 " -DPKT_SIZE_FRAMEBUF=1552"; 

// back up original value of Pkg.libDir
var PkglibDirOrig = Pkg.libDir;

/*
 * Build all stack libraries
 *
 * We must build all permutations of the NDK core stack library for all targets
 */
for (var i = 0; i < Build.targets.length; i++) {
    var target = Build.targets[i];

    /*
     * stk.lib
     */
    var libOptions = {
        copts: "-D_NDK_EXTERN_CONFIG -D_INCLUDE_NIMU_CODE -D_INCLUDE_JUMBOFRAME_SUPPORT",
        incs: ndkPathInclude,
    };

    // first library to build
    var libName = "stk";

    // build M3 library with reduced buffer sizes for pbm.c and jumbo_pbm.c
    if (target.name == "M3") {
        libOptions.copts += m3PbmCopts;
    }

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(coreLibFiles);

    /*
     * stk_ppp.lib
     */
    var libName = "stk_ppp";
    var libOptions = {
            copts: "-D_INCLUDE_PPP_CODE -D_NDK_EXTERN_CONFIG -D_INCLUDE_NIMU_CODE -D_INCLUDE_JUMBOFRAME_SUPPORT",
            incs: ndkPathInclude, 
    };
    if (target.name == "M3") {
        libOptions.copts += m3PbmCopts;
    }

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(coreLibFiles);

    /*
     * stk6_ppp.lib
     */
    var libName = "stk6_ppp";
    var libOptions = {
            copts: "-D_INCLUDE_PPP_CODE -D_NDK_EXTERN_CONFIG " +
                   "-D_INCLUDE_NIMU_CODE -D_INCLUDE_IPv6_CODE -D_INCLUDE_JUMBOFRAME_SUPPORT",
            incs: ndkPathInclude, 
    };

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(coreLibFiles);

    /*
     * stk_ppp_pppoe.lib
     */
    var libName = "stk_ppp_pppoe";
    var libOptions = {
            copts: "-D_INCLUDE_PPP_CODE -D_INCLUDE_PPPOE_CODE " +
                   "-D_NDK_EXTERN_CONFIG -D_INCLUDE_NIMU_CODE -D_INCLUDE_JUMBOFRAME_SUPPORT",
            incs: ndkPathInclude, 
    };

    // build M3 library with reduced buffer sizes for pbm.c and jumbo_pbm.c
    if (target.name == "M3") {
        libOptions.copts += m3PbmCopts;
    }

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(coreLibFiles);

    /*
     * stk6_ppp_pppoe.lib
     */
    var libName = "stk6_ppp_pppoe";
    var libOptions = {
            copts: "-D_INCLUDE_PPP_CODE -D_INCLUDE_PPPOE_CODE " +
                   "-D_NDK_EXTERN_CONFIG -D_INCLUDE_NIMU_CODE " +
                   "-D_INCLUDE_IPv6_CODE -D_INCLUDE_JUMBOFRAME_SUPPORT",
            incs: ndkPathInclude, 
    };

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(coreLibFiles);

    /*
     * stk_nat.lib
     */
    var libName = "stk_nat";
    var libOptions = {
            copts: "-D_INCLUDE_NAT_CODE -D_NDK_EXTERN_CONFIG " +
                   "-D_INCLUDE_NIMU_CODE -D_INCLUDE_JUMBOFRAME_SUPPORT",
            incs: ndkPathInclude, 
    };

    // build M3 library with reduced buffer sizes for pbm.c and jumbo_pbm.c
    if (target.name == "M3") {
        libOptions.copts += m3PbmCopts;
    }

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(coreLibFiles);

    /*
     * stk6_nat.lib
     */
    var libName = "stk6_nat";
    var libOptions = {
            copts: "-D_INCLUDE_NAT_CODE -D_NDK_EXTERN_CONFIG " +
                   "-D_INCLUDE_NIMU_CODE -D_INCLUDE_IPv6_CODE -D_INCLUDE_JUMBOFRAME_SUPPORT",
            incs: ndkPathInclude, 
    };

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(coreLibFiles);

    /*
     * stk_nat_ppp.lib
     */
    var libName = "stk_nat_ppp";
    var libOptions = {
            copts: "-D_INCLUDE_NAT_CODE -D_INCLUDE_PPP_CODE " +
                   "-D_NDK_EXTERN_CONFIG -D_INCLUDE_NIMU_CODE -D_INCLUDE_JUMBOFRAME_SUPPORT",
            incs: ndkPathInclude, 
    };

    // build M3 library with reduced buffer sizes for pbm.c and jumbo_pbm.c
    if (target.name == "M3") {
        libOptions.copts += m3PbmCopts;
    }

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(coreLibFiles);

    /*
     * stk6_nat_ppp.lib
     */
    var libName = "stk6_nat_ppp";
    var libOptions = {
            copts: "-D_INCLUDE_NAT_CODE -D_INCLUDE_PPP_CODE " +
                   "-D_NDK_EXTERN_CONFIG -D_INCLUDE_NIMU_CODE " +
                   "-D_INCLUDE_IPv6_CODE -D_INCLUDE_JUMBOFRAME_SUPPORT",
            incs: ndkPathInclude, 
    };

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(coreLibFiles);

    /*
     * stk_nat_ppp_pppoe.lib
     */
    var libName = "stk_nat_ppp_pppoe";
    var libOptions = {
            copts: "-D_INCLUDE_NAT_CODE -D_INCLUDE_PPP_CODE " +
                   "-D_INCLUDE_PPPOE_CODE -D_NDK_EXTERN_CONFIG " +
                   "-D_INCLUDE_NIMU_CODE -D_INCLUDE_JUMBOFRAME_SUPPORT",
            incs: ndkPathInclude, 
    };

    // build M3 library with reduced buffer sizes for pbm.c and jumbo_pbm.c
    if (target.name == "M3") {
        libOptions.copts += m3PbmCopts;
    }

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(coreLibFiles);

    /*
     * stk6_nat_ppp_pppoe.lib
     */
    var libName = "stk6_nat_ppp_pppoe";
    var libOptions = {
            copts: "-D_INCLUDE_NAT_CODE -D_INCLUDE_PPP_CODE " +
                   "-D_INCLUDE_PPPOE_CODE -D_NDK_EXTERN_CONFIG " +
                   "-D_INCLUDE_NIMU_CODE -D_INCLUDE_IPv6_CODE -D_INCLUDE_JUMBOFRAME_SUPPORT",
            incs: ndkPathInclude, 
    };

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(coreLibFiles);

    /*
     * stk6.lib
     */
    var libName = "stk6";
    var libOptions = {
            copts: "-D_NDK_EXTERN_CONFIG -D_INCLUDE_NIMU_CODE " +
                   "-D_INCLUDE_IPv6_CODE -D_INCLUDE_JUMBOFRAME_SUPPORT",
            incs: ndkPathInclude, 
    };

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(coreLibFiles);
}

/* include source files in the release package */
Pkg.attrs.exportSrc = true;
Pkg.attrs.exportCfg = true;

- Rebuilded NDK core as mentioned in : http://processors.wiki.ti.com/index.php/Rebuilding_The_NDK_Core_Using_Gmake

Compilation was success. I rebuilded my project by specifying new NDK package path at properties->ccs build->variables

Project compilation was success. I updated my code to send packet of size 2KB and also enabled the Jumboframe option in Host PC.

With these configurations when i run my project, i observed that data going well but in terms of two packs instead of one packet. First packet size is 1514 and second is 600 bytes, Based on this i felt like my jumbo frame option is not enabled in NDK.

May i know anything else i missed to work with jumbo frames?

Thanks

netctrl_dir_package_bld.txt
/*
 * Copyright (c) 2012, Texas Instruments Incorporated
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * *  Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * *  Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * *  Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * */
/*
 * ======== package.bld ========
 */

Pkg.otherFiles = ["package.bld"];

/* List of all the NETCTRL Files */
var netCtrlLibFiles = [
    "netctrl.c",
    "netsrv.c",
];


/*
 *     Build 3 different library variations for NETCTRL
 * 
 *  The NETCTRL library is designed to support "potential" stack features
 *  that the user may desire within their application (e.g. DHCP server). 
 *  However, the drawback of this is that the code for such features will
 *  be included in the executable even if the application never uses said 
 *  feature. This results in a larger footprint than is usually necessary.
 * 
 *  To minimize this problem, there are now 3 different versions of the 
 *  NETCTRL library that are available:
 * 
 *     - netctrl_min:   This minimal library enables the following
 *                          services.  It should be used when a minimal
 *                          footprint is desired:
 * 
 *           - DHCP client
 * 
 * 
 *     - netctrl:   This "standard" version of the NETCTRL library
 *                          enables the following features and has a medium
 *                          footprint:
 * 
 *           - Telnet server
 *           - Http server
 *           - DHCP client
 * 
 * 
 *     - netctrl_full:  This "full" library enables all supported
 *                          NETCTRL features, which include:
 * 
 *           - Telnet server
 *           - Http server
 *           - NAT server
 *           - DHCP client
 *           - DHCP server
 *           - DNS server
 * 
 *  In turn, each of the above is built for both pure IPv4 as well as IPv6.
 * 
 *  The library flavors specified above take advantage of the define 
 *  "_NDK_EXTERN_CONFIG".  This allows the build to override the following
 *  definitions that exist in netsrv.h, which, without defining 
 *  "_NDK_EXTERN_CONFIG", would control the features that are brought into
 *  the netctrl library:
 * 
 *      - NETSRV_ENABLE_TELNET
 *      - NETSRV_ENABLE_HTTP
 *      - NETSRV_ENABLE_NAT
 *      - NETSRV_ENABLE_DHCPCLIENT
 *      - NETSRV_ENABLE_DHCPSERVER
 *      - NETSRV_ENABLE_DNSSERVER
 * 
 */

/* Build the libraries for all the targets specified. */
for (var i = 0; i < Build.targets.length; i++) {
    var target = Build.targets[i];

    /* We build two versions of the library, i.e. NIMU + IPv6 with and without
     * Jumbo Frame Support Enabled.
     */
    /*********************************************************************
     ************** IPv6 and no Jumbo Frame Support Version **************
     *********************************************************************/
    /* IPv6 netctrl_min library */
    var libOptions = {
        copts: " -D_NDK_EXTERN_CONFIG " +
               " -DNETSRV_ENABLE_TELNET=0 " +
               " -DNETSRV_ENABLE_HTTP=0 " +
               " -DNETSRV_ENABLE_NAT=0 " +
               " -DNETSRV_ENABLE_DHCPCLIENT=1   " +
               " -DNETSRV_ENABLE_DHCPSERVER=0 " +
               " -DNETSRV_ENABLE_DNSSERVER=0 " +
               " -DUSE_EVENT_SEMAPHORE=1 -DUSE_SERIAL_PORT=0 " +
               " -D_INCLUDE_JUMBOFRAME_SUPPORT " +
               " -D_INCLUDE_NIMU_CODE -D_INCLUDE_IPv6_CODE",
        incs: ndkPathInclude, 
    };

    // first library to build
    var libName = "netctrl_min";

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(netCtrlLibFiles);

    /* IPv6 netctrl "standard" library */
    var libName = "netctrl";
    var libOptions = {
        copts: " -D_NDK_EXTERN_CONFIG " +
               " -DNETSRV_ENABLE_TELNET=1 " +
               " -DNETSRV_ENABLE_HTTP=1 " +
               " -DNETSRV_ENABLE_NAT=0 " +
               " -DNETSRV_ENABLE_DHCPCLIENT=1 " +
               " -DNETSRV_ENABLE_DHCPSERVER=0 " +
               " -DNETSRV_ENABLE_DNSSERVER=0 " +
               " -DUSE_EVENT_SEMAPHORE=1 -DUSE_SERIAL_PORT=0 " +
               " -D_INCLUDE_JUMBOFRAME_SUPPORT " +
               " -D_INCLUDE_NIMU_CODE -D_INCLUDE_IPv6_CODE",
        incs: ndkPathInclude, 
    };

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(netCtrlLibFiles);
   
    /* IPv6 netctrl_full library */
    var libName = "netctrl_full";
    var libOptions = {
        copts: " -D_NDK_EXTERN_CONFIG " +
               " -DNETSRV_ENABLE_TELNET=1 " +
               " -DNETSRV_ENABLE_HTTP=1 " +
               " -DNETSRV_ENABLE_NAT=1 " +
               " -DNETSRV_ENABLE_DHCPCLIENT=1 " +
               " -DNETSRV_ENABLE_DHCPSERVER=1 " +
               " -DNETSRV_ENABLE_DNSSERVER=1 " +
               " -DUSE_EVENT_SEMAPHORE=1 -DUSE_SERIAL_PORT=0 " +
               " -D_INCLUDE_JUMBOFRAME_SUPPORT " +
               " -D_INCLUDE_NIMU_CODE -D_INCLUDE_IPv6_CODE",
        incs: ndkPathInclude, 
    };

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(netCtrlLibFiles);
    
    /*********************************************************************
     ************** IPv4 and no Jumbo Frame Support Version **************
     *********************************************************************/
    /* IPv4 netctrl_min library */
    var libName = "netctrl_min_ipv4";
    var libOptions = {
        copts: " -D_NDK_EXTERN_CONFIG " +
               " -DNETSRV_ENABLE_TELNET=0" +
               " -DNETSRV_ENABLE_HTTP=0"   +
               " -DNETSRV_ENABLE_NAT=0"    +
               " -DNETSRV_ENABLE_DHCPCLIENT=1" +
               " -DNETSRV_ENABLE_DHCPSERVER=0" +
               " -DNETSRV_ENABLE_DNSSERVER=0"  +
               " -DUSE_EVENT_SEMAPHORE=1 -DUSE_SERIAL_PORT=0 " +
               " -D_INCLUDE_JUMBOFRAME_SUPPORT " +
               " -D_INCLUDE_NIMU_CODE ",
        incs: ndkPathInclude, 
    };

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(netCtrlLibFiles);

    /* IPv4 netctrl "standard" library */
    var libName = "netctrl_ipv4";
    var libOptions = {
        copts: " -D_NDK_EXTERN_CONFIG " +
               " -DNETSRV_ENABLE_TELNET=1" +
               " -DNETSRV_ENABLE_HTTP=1"   +
               " -DNETSRV_ENABLE_NAT=0"    +
               " -DNETSRV_ENABLE_DHCPCLIENT=1" +
               " -DNETSRV_ENABLE_DHCPSERVER=0" +
               " -DNETSRV_ENABLE_DNSSERVER=0"  +
               " -DUSE_EVENT_SEMAPHORE=1 -DUSE_SERIAL_PORT=0 " +
               " -D_INCLUDE_JUMBOFRAME_SUPPORT " +
               " -D_INCLUDE_NIMU_CODE ",
        incs: ndkPathInclude, 
    };

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(netCtrlLibFiles);

    /* IPv4 netctrl_full library */
    var libName = "netctrl_full_ipv4";
    var libOptions = {
        copts: " -D_NDK_EXTERN_CONFIG " +
               " -DNETSRV_ENABLE_TELNET=1" +
               " -DNETSRV_ENABLE_HTTP=1"   +
               " -DNETSRV_ENABLE_NAT=1"    +
               " -DNETSRV_ENABLE_DHCPCLIENT=1" +
               " -DNETSRV_ENABLE_DHCPSERVER=1" +
               " -DNETSRV_ENABLE_DNSSERVER=1"  +
               " -DUSE_EVENT_SEMAPHORE=1 -DUSE_SERIAL_PORT=0 " +
               " -D_INCLUDE_JUMBOFRAME_SUPPORT " +
               " -D_INCLUDE_NIMU_CODE ",
        incs: ndkPathInclude, 
    };

    var lib = Pkg.addLibrary("lib/" + libName, target, libOptions);
    lib.addObjects(netCtrlLibFiles);
}

/* include source files in the release package */
Pkg.attrs.exportSrc = true;
Pkg.attrs.exportCfg = true;