Lines Matching defs:com2
99 /* Delete all communities listed in com2 from com1 */
101 community_delete (struct community *com1, struct community *com2)
105 while(i < com2->size)
107 community_del_val (com1, com2->val + i);
404 community_match (struct community *com1, struct community *com2)
409 if (com1 == NULL && com2 == NULL)
412 if (com1 == NULL || com2 == NULL)
415 if (com1->size < com2->size)
418 /* Every community on com2 needs to be on com1 for this to match */
419 while (i < com1->size && j < com2->size)
421 if (memcmp (com1->val + i, com2->val + j, sizeof (u_int32_t)) == 0)
426 if (j == com2->size)
435 community_cmp (struct community *com1, struct community *com2)
437 if (com1 == NULL && com2 == NULL)
439 if (com1 == NULL || com2 == NULL)
442 if (com1->size == com2->size)
443 if (memcmp (com1->val, com2->val, com1->size * 4) == 0)
448 /* Add com2 to the end of com1. */
450 community_merge (struct community *com1, struct community *com2)
454 (com1->size + com2->size) * 4);
456 com1->val = XMALLOC (MTYPE_COMMUNITY_VAL, (com1->size + com2->size) * 4);
458 memcpy (com1->val + com1->size, com2->val, com2->size * 4);
459 com1->size += com2->size;