/*
 *========================================================================
 * $Id: identity.c 88 2004-09-28 22:49:38Z rgb $
 *
 * See copyright in copyright.h and the accompanying file COPYING
 *========================================================================
 */

#include <wulfware/libwulf.h>

/*
 * <identity> tag init and update (same thing)
 */
void init_identity(Host *hostptr)
{

 /*
  * node hostname (if any)
  */
 if(xtract(STRING,hostptr->val.time,value_xpath[HOSTNAME],hostptr->xp_doc) > 1){
   fprintf(OUTFP,"fill_values() Warning: %s not unique content tag.\n",value_xpath[HOSTNAME]);
 }
 if((verbose == D_ALL) || (verbose == D_VALUES)){
   fprintf(OUTFP,"D_VALUES: Hostname = %s\n",hostptr->val.hostname);
 }

 /*
  * node hostip
  */
 if(xtract(STRING,hostptr->val.time,value_xpath[HOSTIP],hostptr->xp_doc) > 1){
   fprintf(OUTFP,"fill_values() Warning: %s not unique content tag.\n",value_xpath[HOSTIP]);
 }
 if((verbose == D_ALL) || (verbose == D_VALUES)){
   fprintf(OUTFP,"D_VALUES: Hostname = %s\n",hostptr->val.hostip);
 }

}


void update_identity(Host *hostptr)
{

 /*
  * node hostname (if any)
  */
 if(xtract(STRING,hostptr->val.time,value_xpath[HOSTNAME],hostptr->xp_doc) > 1){
   fprintf(OUTFP,"fill_values() Warning: %s not unique content tag.\n",value_xpath[HOSTNAME]);
 }
 if((verbose == D_ALL) || (verbose == D_VALUES)){
   fprintf(OUTFP,"D_VALUES: Hostname = %s\n",hostptr->val.hostname);
 }

 /*
  * node hostip
  */
 if(xtract(STRING,hostptr->val.time,value_xpath[HOSTIP],hostptr->xp_doc) > 1){
   fprintf(OUTFP,"fill_values() Warning: %s not unique content tag.\n",value_xpath[HOSTIP]);
 }
 if((verbose == D_ALL) || (verbose == D_VALUES)){
   fprintf(OUTFP,"D_VALUES: Hostname = %s\n",hostptr->val.hostip);
 }

}
