1 / 32

ACE Address Configuration Executive

ACE Address Configuration Executive. Why ACE?. ACE provides access to several address resolution protocols under a single API ACE is the only API available in Version 6 to obtain an IP address. What ACE does.

Download Presentation

ACE Address Configuration Executive

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ACE Address Configuration Executive

  2. Why ACE? • ACE provides access to several address resolution protocols under a single API • ACE is the only API available in Version 6 to obtain an IP address

  3. What ACE does • Runs one or more address resolution protocols on a timeline provided by an input table • Calls BSP-defined callbacks on IP address events • Stops and restarts protocols as required

  4. Starting ACE int aceStart(const char * ifname, const aceProtocolInfo * proto_info, int num_protocols, aceHaveAddrCallback have_addr_fn, aceHaveAddrCallback have_2nd_addr_fn, aceLostAddrCallback lost_address_fn);

  5. TheaceProtocolInfo structure typedef struct { aceProtoStartInfo proto_start_info; void * proto_specific_info; size_t proto_specific_info_size; size_t proto_event_info_size; aceProtoStartSrvRtn start_protocol_fn; aceProtoStopSrvRtn stop_protocol_fn; aceProtoGetAddrSrvRtn get_addr_fn; aceProtoReleaseAddrSrvRtn release_addr_fn; } aceProtocolInfo;

  6. aceProtocolInfo Fields

  7. aceProtocolInfo Fields (2)

  8. The aceProtoStartInfo Structure typedef struct { int protocol; unsigned int priority; time_t delay_before_start; aceProtoShutdownType shutdown_type; } aceProtoStartInfo;

  9. Shutdown Types typedef enum { ACE_ALWAYS_SHUTDOWN = 0, ACE_CONT_IF_GOT_ADDRESS = 1, ACE_NEVER_SHUTDOWN = 2} aceProtoShutdownType;

  10. Example Protocol-Specific Information typedef struct { BOOLEAN isConfigValid; BOOLEAN isEnabled; WORD32 autoip_local_addr; aceProtoStartInfo startInfo; } configAceAutoipInfo;

  11. ACE Starts a Protocol… • After the delay specified in delay_before_start from aceProtoStartInfo • By calling the start_protocol_fn from aceProtocolInfo • Passing it proto_specific_info from aceProtocolInfo

  12. When an Address Event is Detected… • The protocol calls aceAddressEvent() with protocol-specific event information • ACE copies the information into an internal table and returns • The ACE thread resolves redundant address events and invokes the appropriate BSP callback to inform the BSP

  13. Address Events typedef enum { ACE_ADDR_NULL = 0, ACE_ADDR_NEW = 1, ACE_ADDR_RENEWED = 2, ACE_ADDR_REBOUND = 3, ACE_ADDR_LOST = 4 } aceAddrEventType;

  14. aceAddrInfo Structure • typedef struct { • WORD32 ipaddr; • WORD32 netmask; • WORD32 servaddr; • WORD32 def_gateway; • int mtu; • WORD32 name_server_address[ACE_MAX_DNS_SERVERS]; • } aceAddrInfo;

  15. ACE Callbacks • typedef BOOLEAN (* aceHaveAddrCallback) ( const char * ifname, int protocol, aceAddrEventType addr_event, aceAddrInfo * addr_info, const void * proto_event_info, size_t proto_event_info_size);

  16. ACE Callbacks(2) • aceHaveAddrCallback - IP address has been obtained or renewed • To use this IP address, the callback must configure the interface’s IP address and return TRUE. ACE will update its IP address information for the interface, and shut down protocols according to their shutdown type.

  17. ACE Callbacks (3) • To discard the IP address the callback must return FALSE • ACE calls have_addr_fn() when the interface that obtained an IP address is not yet configured, or on an ACE_ADDR_RENEWED event • ACE calls have_2nd_addr_fn() when the interface that obtained an IP address is already configured with the IP address.

  18. ACE Callbacks (4) • typedef void (* aceLostAddrCallback) ( const char * ifname, int protocol, aceAddrEventType addr_event);

  19. ACE Callbacks (5) • aceLostAddrCallback – IP address has been lost. • This callback must unconfigure an interface that lost the IP address. • ACE will restart all protocols that need restarting according to their delay before start.

  20. Adding a Protocol • Add protocol service routines • Add aceAddressEvents() calls • The protocol should not run on the ACE thread unless it is trivial.

  21. Protocol Service Routines • typedef BOOLEAN (* aceProtoStartSrvRtn) (char * ifname, void * handle, const void * proto_spec_info, size_t proto_spec_info_size); • typedef BOOLEAN (* aceProtoStopSrvRtn)(char * ifname); • typedef BOOLEAN (* aceProtoGetAddrSrvRtn) (void * handle, const void * event_info, size_t event_info_size, aceAddrInfo * addr_info); • typedef void (* aceProtoReleaseAddrSrvRtn)(char * ifname);

  22. How does the BSP run ACE?

  23. Supported Protocols • ACE_PROT_BOOTP • ACE_PROT_DHCP • ACE_PROT_AUTOIP • ACE_PROT_PING_ARP • ACE_PROT_RARP • ACE_PROT_STATIC • Defined in ace_params.h

  24. Protocol Specific Structures • configAceDhcpInfo • configAceBootpInfo • configAceAutoipInfo • configAceRarpInfo • configAcePingArpInfo • configAceStaticInfo • In addition to specific data, each has isConfigValid and isEnabled fields, and generic startup data.

  25. aceConfigInterfaceInfoStructure • typedef struct { BOOLEAN isConfigValid; • BOOLEAN isEnabled; • char ifname[NETOS_MAX_IF_NAMELEN + 1]; • configAceStaticInfo static_config; • configAceDhcpInfo dhcp_config; • configAceBootpInfo bootp_config; • configAceAutoipInfo autoip_config; • configAceRarpInfo rarp_config; • configAcePingArpInfo ping_arp_config; • } aceConfigInterfaceInfo;

  26. aceConfigInfo Structure • typedef struct • { • int version; aceConfigInterfaceInfo ace_interface_info[CONFIG_ACE_MAX_INTERFACES]; • } aceConfigInfo; • Defined in ace_params.h. • Part of board parameters, stored in NVRAM

  27. Default ACE Configuration • aceParams.c has the default ACE configuration. • To change ACE configuration in NVRAM: 1. Change the default table in aceParams.c 2. Rebuild and reload the application 3. To reset board configuration to default, answer YES to the dialog question: “Reset configuration to default values?”

  28. Default ACE Configuration (2) • APP_USE_STATIC_IP is defined to TRUE, ACE runs static IP address on eth0 • If APP_USE_STATIC_IP is defined to FALSE, ACE obtains IP address from the network on eth0 • If APP_ENABLE_AUTO_IP is defined to TRUE, ACE runs Auto IP on eth0:0

  29. The customizeStartAce function • Called by netosStartTCP • Performs these steps: • Reads ACE configuration data from NVRAM. • Calls aceInitialize to initialize data structures inside ACE. • Extracts the protocol-specific information for each interface from the NVRAM structure. • Calls NAIfconfigBringDeviceUp to start the device for each enabled interface. • Calls aceStart for each enabled interface to start the process of getting an IP address.

  30. The customizeStopAce function • Call this function to • stop ACE on a specified interface, and • unconfigure the IP address for the interface.

  31. Default ACE Callbacks • customizeAceHaveAddress - configures the interface with the IP address by calling customizeAceConfigureInterface and returns TRUE. Makes a query for global IP parameters for DHCP. • customizeAceHaveAnotherAddress – discards an IP address and returns FALSE. • customizeAceLostAddress – for Auto IP only, unconfigures interface and continues to run; for other protocols, resets the board.

  32. High Level IP address Configuration API • customizeAceGetInterfaceAddrInfo – if an address has been configured, returns this address and TRUE; otherwise, returns FALSE. • customizeAceConfigureInterface – configures an IP address, subnet mask, default gateway (if present), DNS servers (if present), and global IP parameters (if present). • customizeAceClearInterfaceConfiguration – unconfigures the IP address for the interface.

More Related