dag_config_get_string_attribute(3)

NAME
dag_config_get_string_attribute. retrieves the value of a string attribute.

SYNOPSIS
#include "dag_config.h "

uint8_t
dag_config_get_string_attribute(dag_card_ref_t card, attr_uuid_t uuid);.

DESCRIPTION
dag_config_get_string_attribute returns the value of a string attribute.

RETURN VALUE
The value of the string attribute.

EXAMPLE
The following program illustrates how the function is used. It reads the mac-address attribute of all ports on the card. For the sake of clarity the error-handling code has been omitted from this example.
 int main(int argc, const char* argv[])
 {

   dag_card_ref_t card_ref = NULL;
   dag_component_t root_component = NULL;
   uint32_t count;
   uint32_t i;

   char *mac_address;
   /* Get a reference to the card. */
   card_ref = dag_config_init("/dev/dag0");
   /* Get a reference to the root component. */
   root_component = dag_config_get_root_component(card_ref);
   /* Find out how many ports the card has. */
   count = dag_component_get_subcomponent_count_of_type(root_component,
   kComponentPort);

   for (i = 0; i < count; i++)
   {
          dag_component_t port = NULL;
          attr_uuid_t active_uuid = 0;
          char* val = 0;
          /* Get a reference to the port. */
          port=dag_component_get_subcomponent(root,kComponentXGMII,i);
          active_uuid=dag_component_get_attribute_uuid(port,kStringAttributeEthernetMACAddress);
      /* Read and display the value of the attribute. */
          mac_address = dag_config_get_string_attribute(card_ref,
           active_uuid);
          printf("mac address for port %d is %s,i,mac_address);
   }
   /* Dispose of the card. */
   dag_config_dispose(card_ref);
   return EXIT_SUCCESS;
 }

SEE ALSO
dag_config_get_char_component(3),dag_config_get_int32_component(3),dag_config_get_uint32_component(3),dag_config_get_int32_component(3),dag_config_get_string_component(3),dag_config_get_uint64_component(3)

BUGS
Report bugs to <support@endace.com>.

LAST UPDATED
$Author: nuwan.gunasekara $
$Revision: 13756 $
$Date: 2011-01-17 11:22:36 +1300 (Mon, 17 Jan 2011) $

COPYRIGHT
(c) 2009 Endace Technology Ltd, Hamilton, New Zealand. All Rights Reserved.