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.

NDK configuration items



Hello,

I was wondering how the NDK uses the configuration items exactly.  When I set the SOCKUDPRXLIMIT for example, I don't see where that value is used in the ndk.  I mean, if I search for that #define, I only see where it is being set in the CfgAddEntry and not where its being to say, limit the UDP receive packet.


// UDP Receive limit

rc =8192;

CfgAddEntry( hCfg, CFGTAG_IP, CFGITEM_IP_SOCKUDPRXLIMIT, CFG_ADDMODE_UNIQUE, sizeof(uint), (UINT8 *)&rc, 0 );

Can someone please explain this to me?  Maybe my search is not looking in the correct directories.

Thanks,
Brandy

  • Hi Brandy,

    The NDK defines a struct of type IPCONFIG with default values (in  ti/ndk/stack/res/exec.c):


    // Configuration Structure
    IPCONFIG _ipcfg = { DEF_ICMP_DO_REDIRECT,
                        DEF_ICMP_TTL,
                        DEF_ICMP_TTL_ECHO,
                        DEF_IP_INDEX,
                        DEF_IP_FORWARDING,
                        DEF_IP_NATENABLE,
                        DEF_IP_FILTERENABLE,
                        DEF_IP_REASM_MAXTIME,
                        DEF_IP_REASM_MAXSIZE,
                        DEF_IP_DIRECTED_BCAST,
                        DEF_TCP_REASM_MAXPKT,
                        DEF_RTC_ENABLE_DEBUG,
                        DEF_RTC_RTADV_TIME,
                        DEF_RTC_RTADV_LIFE,
                        DEF_RTC_RTADV_PREF,
                        DEF_LLI_ARP_DOWN_TIME,
                        DEF_LLI_KEEPALIVE_TIMEOUT,
                        DEF_LLI_INACTIVITY_TIMEOUT,
                        DEF_ROUTE_CLONE_TIMEOUT,
                        DEF_ROUTE_DEFAULT_MTU,
                        DEF_SOCK_TTL_DEFAULT,
                        DEF_SOCK_TOS_DEFAULT,
                        DEF_SOCK_MAXCONNECT,
                        DEF_SOCK_TIMECONNECT,
                        DEF_SOCK_TIMEIO,
                        DEF_SOCK_TCPTXBUF,
                        DEF_SOCK_TCPRXBUF,
                        DEF_SOCK_TCPRXLIMIT,
                        DEF_SOCK_UDPRXLIMIT,    // <-- UDP RX LIMIT
                        DEF_SOCK_BUFMINTX,
                        DEF_SOCK_BUFMINRX,
                        DEF_PIPE_TIMEIO,
                        DEF_PIPE_BUFSIZE,
                        DEF_PIPE_BUFMINTX,
                        DEF_PIPE_BUFMINRX,
                        DEF_TCP_KEEP_IDLE,
                        DEF_TCP_KEEP_INTVL,
                        DEF_TCP_KEEP_MAXIDLE,
                        DEF_ICMP_DONT_REPLY_BCAST,
                        DEF_ICMP_DONT_REPLY_MCAST,
                        DEF_RT_RTGARP,
                        DEF_ICMP_DONT_REPLY_ECHO,
                        DEF_UDP_SEND_ICMP_PORTUNREACH,
                        DEF_TCP_SEND_RST,
                        DEF_SOCK_RAWETHRXLIMIT,
                      };



    Then in ti/ndk/inc/stack/inc/resif.h is where the magic is found.  Here there are macros that reference the values in the above struct:

        extern IPCONFIG _ipcfg;             // Configuration

        #define SOCK_UDPRXLIMIT         (_ipcfg.SockUdpRxLimit)


    When the application changes the configuration values using the CfgAddEntry() API (or ti.ndk.config package), these struct values are modified to be the new values.

    Steve

  • So then

    #define CFGITEM_IP_SOCKUDPRXLIMIT  29  // UDP Receive limit

    is set to the 29th item in the structure which aligns with SOCKUDPRXLIMIT.  Ok.

    Then we build a configuration, and it gets copied on top of the defaults in the CfgExecute() function called by the NS_BootTask?

    I guess, you can figure out this question is related to my post about the ICMP/Destination Port Unreachable. 

    Thanks for your help!

    Brandy