Juniper JUNOS OS 10.3 - XML MANAGEMENT PROTOCOL GUIDE 6-30-2010 Manual page 262

Junos xml management protocol guide
Hide thumbs Also See for JUNOS OS 10.3 - XML MANAGEMENT PROTOCOL GUIDE 6-30-2010:
Table of Contents

Advertisement

Junos 10.3 Junos XML Management Protocol Guide
240
printf("IGMP Groups: %s\n", igmp_result_buff[count_a]);
#endif
xmlFree(keyword_ptr);
xmlChar *keyword_ptr = NULL;
}
xmlXPathFreeObject(igmp_result);
}
xmlFreeDoc(doc);
xmlCleanupParser();
//--End of xPath search--//
//--Code to compare pim groups to configured igmp static membership--//
conf_chg = 0;
count_x=0;
//--Track pim groups--//
count_y=0;
//--Track igmp groups--//
count_z=0;
//--Track matches (if set to 1, igmp group matched pim group)--//
while(strstr(pim_result_buff[count_x], "2") != NULL) {
//--Run through igmp pim groups--//
if(strstr(igmp_result_buff[count_y], "2") == NULL) {
count_z = 0;
conf_chg = 1;
}
while(strstr(igmp_result_buff[count_y], "2") != NULL) {
//--For each pim group, run through all igmp groups--//
if(strcmp(igmp_result_buff[count_y], pim_result_buff[count_x]) == 0) {
//--If igmp group matches pim group, set z to 1 --//
//-- (ie count_z=1; --//
//--Set z to 1 if there was a match (ie - the static --//
//--membership is configured)--//
}
count_y++;
//--Increment igmp result buffer--//
}
if(count_z == 0) {
//--If no igmp group matched the --//
//--pim group (z stayed at 0), configure--//
//--static membership--//
printf("Adding this group to igmp: %s\n", pim_result_buff[count_x]);
sprintf(temp_buff, js_add_group, minterface,
pim_result_buff[count_x], msource);
//--Copy js_add_group with pim group to temp_buff--//
#ifdef PRINT
printf("%s", temp_buff);
#endif
sock_bytes = write(sockfd, temp_buff, strlen(temp_buff));
while(strstr(small_buff, "</rpc-reply>") == NULL) {
sock_bytes = read(sockfd, rcvbuffer, 255);
rcvbuffer[sock_bytes] = 0;
strcat(small_buff, rcvbuffer);
}
#ifdef PRINT
printf("%s\n", small_buff);
#endif
bzero(small_buff, strlen(small_buff));
//--Erase (copy all 0's) small buffer contents--//
bzero(temp_buff, strlen(temp_buff));
//--Erase temp_buff contents--//
Copyright © 2010, Juniper Networks, Inc.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Junos os

Table of Contents