Directories and Files

This section discusses the modules available for μC/DHCPc, and how they all fit together. A Windows®-based development platform is assumed. The directories and files make references to typical Windows-type directory structures. However, since μC/DHCPc is available in source form, it can also be used with any ANSI-C compatible compiler/linker and any Operating System.

Below is a summary of all directories and files involved in the µC/DHCPc module. The ‘<-Cfg’ on the far right indicates that these files are typically copied into the application (i.e., project) directory and edited based on project requirements.

\Micrium
    \Software
        \uC-DHCPc
            \Cfg
                \Template
                    \dhpc-c_cfg.h                       <-Cfg 
            \Examples
				dhcp-c_init.c
				dhcp-c_mgr.c
				dhcp-c_multiple_if.c
            \OS
                \uCOS-II
                    \dhcp-c_os.c
                    \dhcp-c_os.h
                \uCOS-III
                    \dhcp-c_os.c
                    \dhcp-c_os.h
            \Source
                \dhcp-c.c
                \dhcp-c.h
  • \Micrium\Software\uC-DHCPc

This is the main directory for µC/DHCPc.
 

  • \Micrium\Software\uC-DHCPc\Cfg\Template

This directory contains a template of µC/DHCPc configuration. Files contained in this folder should be copied to the application folder.
 

  • \Micrium\Software\uC-DHCPc\Source

This directory contains the µC/DHCPc source code. This protocol is implemented in two OS independent files:

dhcp-c.c

dhcp-c.h
 

  • \Micrium\Software\uC-DHCPc\OS\uCOS-II
                                                             \uCOS-III

This is where operating system (OS) dependent code is located. µC/DHCPc is distributed with ports for µC/OS-II and µC/OS-III. Note that it would be possible to use µC/DHCP with other operating systems by developing appropriate dhcp-c_os.* implementation files.
 

  • \Micrium\Software\uC-DHCPc\Examples


dhcp-c_init.c contains an example about how to initialize µC/DHCPc, start a DHCP negotiation on an interface and wait until the negotiation is completed.

dhcp-c_mgr.c contains an example about how to handle DHCP with the link status changes (Link UP to DOWN to UP).

dhcp-c_multiple_if.c shows how to start DHCP negotiations on multiple interface.