• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/router/quagga/bgpd/

Lines Matching defs:ecom

45 ecommunity_free (struct ecommunity **ecom)
47 if ((*ecom)->val)
48 XFREE (MTYPE_ECOMMUNITY_VAL, (*ecom)->val);
49 if ((*ecom)->str)
50 XFREE (MTYPE_ECOMMUNITY_STR, (*ecom)->str);
51 XFREE (MTYPE_ECOMMUNITY, *ecom);
52 ecom = NULL;
61 ecommunity_add_val (struct ecommunity *ecom, struct ecommunity_val *eval)
68 if (ecom->val == NULL)
70 ecom->size++;
71 ecom->val = XMALLOC (MTYPE_ECOMMUNITY_VAL, ecom_length (ecom));
72 memcpy (ecom->val, eval->val, ECOMMUNITY_SIZE);
78 for (p = ecom->val; c < ecom->size; p += ECOMMUNITY_SIZE, c++)
88 ecom->size++;
89 ecom->val = XREALLOC (MTYPE_ECOMMUNITY_VAL, ecom->val, ecom_length (ecom));
91 memmove (ecom->val + (c + 1) * ECOMMUNITY_SIZE,
92 ecom->val + c * ECOMMUNITY_SIZE,
93 (ecom->size - 1 - c) * ECOMMUNITY_SIZE);
94 memcpy (ecom->val + c * ECOMMUNITY_SIZE, eval->val, ECOMMUNITY_SIZE);
103 ecommunity_uniq_sort (struct ecommunity *ecom)
109 if (! ecom)
114 for (i = 0; i < ecom->size; i++)
116 eval = (struct ecommunity_val *) (ecom->val + (i * ECOMMUNITY_SIZE));
147 ecommunity_dup (struct ecommunity *ecom)
152 new->size = ecom->size;
155 new->val = XMALLOC (MTYPE_ECOMMUNITY_VAL, ecom->size * ECOMMUNITY_SIZE);
156 memcpy (new->val, ecom->val, ecom->size * ECOMMUNITY_SIZE);
165 ecommunity_str (struct ecommunity *ecom)
167 if (! ecom->str)
168 ecom->str = ecommunity_ecom2str (ecom, ECOMMUNITY_FORMAT_DISPLAY);
169 return ecom->str;
192 ecommunity_intern (struct ecommunity *ecom)
196 assert (ecom->refcnt == 0);
198 find = (struct ecommunity *) hash_get (ecomhash, ecom, hash_alloc_intern);
200 if (find != ecom)
201 ecommunity_free (&ecom);
213 ecommunity_unintern (struct ecommunity **ecom)
217 if ((*ecom)->refcnt)
218 (*ecom)->refcnt--;
221 if ((*ecom)->refcnt == 0)
224 ret = (struct ecommunity *) hash_release (ecomhash, *ecom);
227 ecommunity_free (ecom);
235 const struct ecommunity *ecom = arg;
236 int size = ecom->size * ECOMMUNITY_SIZE;
237 u_int8_t *pnt = ecom->val;
513 struct ecommunity *ecom = NULL;
526 if (ecom)
527 ecommunity_free (&ecom);
546 if (ecom)
547 ecommunity_free (&ecom);
552 if (ecom == NULL)
553 ecom = ecommunity_new ();
555 ecommunity_add_val (ecom, &eval);
559 if (ecom)
560 ecommunity_free (&ecom);
564 return ecom;
589 ecommunity_ecom2str (struct ecommunity *ecom, int format)
616 if (ecom->size == 0)
628 for (i = 0; i < ecom->size; i++)
641 pnt = ecom->val + (i * 8);