Commit 3d32f08c authored by claes's avatar claes

Trace on GetAp and GetIp

parent 09e435df
...@@ -4364,7 +4364,7 @@ int gre_set_trace_attributes( gre_ctx grectx, char *host) ...@@ -4364,7 +4364,7 @@ int gre_set_trace_attributes( gre_ctx grectx, char *host)
{ {
flow_eTraceType trace_type; flow_eTraceType trace_type;
char object_str[120]; char object_str[120];
char attr_str[80]; char attr_str[120] = "";
int sts, i, j, size; int sts, i, j, size;
vldh_t_wind wind; vldh_t_wind wind;
unsigned long node_count; unsigned long node_count;
...@@ -4374,6 +4374,7 @@ int gre_set_trace_attributes( gre_ctx grectx, char *host) ...@@ -4374,6 +4374,7 @@ int gre_set_trace_attributes( gre_ctx grectx, char *host)
int rows; int rows;
pwr_sAttrRef *objarp; pwr_sAttrRef *objarp;
char *np; char *np;
char *s;
wind = grectx->wind; wind = grectx->wind;
sts = vldh_get_nodes( wind, &node_count, &nodelist); sts = vldh_get_nodes( wind, &node_count, &nodelist);
...@@ -4394,10 +4395,8 @@ int gre_set_trace_attributes( gre_ctx grectx, char *host) ...@@ -4394,10 +4395,8 @@ int gre_set_trace_attributes( gre_ctx grectx, char *host)
flow_SetTraceAttr( (*node_ptr)->hn.node_id, object_str, flow_SetTraceAttr( (*node_ptr)->hn.node_id, object_str,
attr_str, trace_type); attr_str, trace_type);
} }
else else {
{ switch( (*node_ptr)->ln.cid ) {
switch( (*node_ptr)->ln.cid )
{
case pwr_cClass_GetAi: case pwr_cClass_GetAi:
case pwr_cClass_GetAo: case pwr_cClass_GetAo:
case pwr_cClass_GetAv: case pwr_cClass_GetAv:
...@@ -4416,6 +4415,8 @@ int gre_set_trace_attributes( gre_ctx grectx, char *host) ...@@ -4416,6 +4415,8 @@ int gre_set_trace_attributes( gre_ctx grectx, char *host)
case pwr_cClass_cstoii: case pwr_cClass_cstoii:
case pwr_cClass_cstoio: case pwr_cClass_cstoio:
case pwr_cClass_cstoiv: case pwr_cClass_cstoiv:
case pwr_cClass_GetAp:
case pwr_cClass_GetIp:
sts = ldh_GetObjectBodyDef( wind->hw.ldhses, sts = ldh_GetObjectBodyDef( wind->hw.ldhses,
(*node_ptr)->ln.cid, "DevBody", 1, (*node_ptr)->ln.cid, "DevBody", 1,
&bodydef, &rows); &bodydef, &rows);
...@@ -4447,6 +4448,19 @@ int gre_set_trace_attributes( gre_ctx grectx, char *host) ...@@ -4447,6 +4448,19 @@ int gre_set_trace_attributes( gre_ctx grectx, char *host)
ldh_eName_Hierarchy, object_str, sizeof(object_str), &size); ldh_eName_Hierarchy, object_str, sizeof(object_str), &size);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
} }
switch ((*node_ptr)->ln.cid ) {
case pwr_cClass_GetAp:
case pwr_cClass_GetIp:
s = strrchr( object_str, '.');
if ( s) {
strcpy( attr_str, s + 1);
*s = 0;
}
break;
default: ;
}
if ( host && strncmp( object_str, host, strlen(host)) == 0) { if ( host && strncmp( object_str, host, strlen(host)) == 0) {
char tmp[120]; char tmp[120];
strcpy( tmp, "$host"); strcpy( tmp, "$host");
...@@ -4454,7 +4468,7 @@ int gre_set_trace_attributes( gre_ctx grectx, char *host) ...@@ -4454,7 +4468,7 @@ int gre_set_trace_attributes( gre_ctx grectx, char *host)
strcpy( object_str, tmp); strcpy( object_str, tmp);
} }
flow_SetTraceAttr( (*node_ptr)->hn.node_id, object_str, flow_SetTraceAttr( (*node_ptr)->hn.node_id, object_str,
"", flow_eTraceType_User); attr_str, flow_eTraceType_User);
} }
node_ptr++; node_ptr++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment