l2vpn
l2vpn_if_new(struct l2vpn *l2vpn, struct kif *kif)
lif->l2vpn = l2vpn;
l2vpn_if_find(struct l2vpn *l2vpn, unsigned int ifindex)
LIST_FOREACH(lif, &l2vpn->if_list, entry)
struct l2vpn *l2vpn = lif->l2vpn;
LIST_FOREACH(pw, &l2vpn->pw_list, entry) {
fec.fec.pwid.type = l2vpn->pw_type;
l2vpn_pw_new(struct l2vpn *l2vpn, struct kif *kif)
pw->l2vpn = l2vpn;
l2vpn_pw_find(struct l2vpn *l2vpn, unsigned int ifindex)
LIST_FOREACH(pw, &l2vpn->pw_list, entry)
fec->u.pwid.type = pw->l2vpn->pw_type;
if (pw->l2vpn->mtu != pw->remote_mtu)
struct l2vpn *
struct l2vpn *l2vpn;
if ((l2vpn = calloc(1, sizeof(*l2vpn))) == NULL)
strlcpy(l2vpn->name, name, sizeof(l2vpn->name));
l2vpn->mtu = DEFAULT_L2VPN_MTU;
l2vpn->pw_type = DEFAULT_PW_TYPE;
struct l2vpn *l2vpn;
LIST_FOREACH(l2vpn, &ldeconf->l2vpn_list, entry) {
LIST_FOREACH(pw, &l2vpn->pw_list, entry) {
LIST_INIT(&l2vpn->if_list);
LIST_INIT(&l2vpn->pw_list);
struct l2vpn *l2vpn;
LIST_FOREACH(l2vpn, &ldeconf->l2vpn_list, entry)
LIST_FOREACH(pw, &l2vpn->pw_list, entry) {
return (l2vpn);
pwctl.local_ifmtu = pw->l2vpn->mtu;
struct l2vpn *
ldpe_l2vpn_init(struct l2vpn *l2vpn)
LIST_FOREACH(pw, &l2vpn->pw_list, entry)
struct l2vpn *l2vpn;
ldpe_l2vpn_exit(struct l2vpn *l2vpn)
LIST_FOREACH(pw, &l2vpn->pw_list, entry)
LIST_FOREACH(l2vpn, &xconf->l2vpn_list, entry)
if (strcmp(l2vpn->name, name) == 0)
return (l2vpn);
l2vpn_del(struct l2vpn *l2vpn)
while ((lif = LIST_FIRST(&l2vpn->if_list)) != NULL) {
while ((pw = LIST_FIRST(&l2vpn->pw_list)) != NULL) {
free(l2vpn);
l2vpn_init(struct l2vpn *l2vpn)
LIST_FOREACH(pw, &l2vpn->pw_list, entry)
l2vpn_exit(struct l2vpn *l2vpn)
LIST_FOREACH(pw, &l2vpn->pw_list, entry)
static struct l2vpn *nl2vpn;
if ((nl2vpn = malloc(sizeof(struct l2vpn))) == NULL)
memcpy(nl2vpn, imsg.data, sizeof(struct l2vpn));
nlif->l2vpn = nl2vpn;
npw->l2vpn = nl2vpn;
map.fec.pwid.ifmtu = pw->l2vpn->mtu;
struct l2vpn *l2vpn_new(const char *);
struct l2vpn *l2vpn_find(struct ldpd_conf *, const char *);
void l2vpn_del(struct l2vpn *);
void l2vpn_init(struct l2vpn *);
void l2vpn_exit(struct l2vpn *);
struct l2vpn_if *l2vpn_if_new(struct l2vpn *, struct kif *);
struct l2vpn_if *l2vpn_if_find(struct l2vpn *, unsigned int);
struct l2vpn_pw *l2vpn_pw_new(struct l2vpn *, struct kif *);
struct l2vpn_pw *l2vpn_pw_find(struct l2vpn *, unsigned int);
struct l2vpn *l2vpn, *ltmp, *xl;
LIST_FOREACH_SAFE(l2vpn, &conf->l2vpn_list, entry, ltmp) {
if ((xl = l2vpn_find(xconf, l2vpn->name)) == NULL) {
LIST_REMOVE(l2vpn, entry);
l2vpn_exit(l2vpn);
ldpe_l2vpn_exit(l2vpn);
l2vpn_del(l2vpn);
if ((l2vpn = l2vpn_find(conf, xl->name)) == NULL) {
merge_l2vpn(conf, l2vpn, xl);
merge_l2vpn(struct ldpd_conf *xconf, struct l2vpn *l2vpn, struct l2vpn *xl)
previous_pw_type = l2vpn->pw_type;
previous_mtu = l2vpn->mtu;
LIST_FOREACH_SAFE(lif, &l2vpn->if_list, entry, ftmp) {
if ((lif = l2vpn_if_find(l2vpn, xf->ifindex)) == NULL) {
LIST_INSERT_HEAD(&l2vpn->if_list, xf, entry);
xf->l2vpn = l2vpn;
LIST_FOREACH_SAFE(pw, &l2vpn->pw_list, entry, ptmp) {
if ((pw = l2vpn_pw_find(l2vpn, xp->ifindex)) == NULL) {
LIST_INSERT_HEAD(&l2vpn->pw_list, xp, entry);
xp->l2vpn = l2vpn;
if (l2vpn->pw_type != xl->pw_type || l2vpn->mtu != xl->mtu ||
l2vpn->pw_type = xl->pw_type;
l2vpn->mtu = xl->mtu;
l2vpn->pw_type = previous_pw_type;
l2vpn->mtu = previous_mtu;
l2vpn->pw_type = xl->pw_type;
l2vpn->mtu = xl->mtu;
strlcpy(l2vpn->br_ifname, xl->br_ifname, sizeof(l2vpn->br_ifname));
l2vpn->br_ifindex = xl->br_ifindex;
static void merge_l2vpn(struct ldpd_conf *, struct l2vpn *,
struct l2vpn *);
struct l2vpn *l2vpn;
LIST_FOREACH(l2vpn, &xconf->l2vpn_list, entry) {
if (main_imsg_compose_both(IMSG_RECONF_L2VPN, l2vpn,
sizeof(*l2vpn)) == -1)
LIST_FOREACH(lif, &l2vpn->if_list, entry) {
LIST_FOREACH(pw, &l2vpn->pw_list, entry) {
struct l2vpn *l2vpn;
struct l2vpn *l2vpn;
LIST_ENTRY(l2vpn) entry;
LIST_HEAD(, l2vpn) l2vpn_list;
static struct l2vpn *l2vpn, *nl2vpn;
LIST_FOREACH(l2vpn, &leconf->l2vpn_list, entry) {
lif = l2vpn_if_find(l2vpn, kif->ifindex);
if ((nl2vpn = malloc(sizeof(struct l2vpn))) == NULL)
memcpy(nl2vpn, imsg.data, sizeof(struct l2vpn));
nlif->l2vpn = nl2vpn;
npw->l2vpn = nl2vpn;
void ldpe_l2vpn_init(struct l2vpn *);
void ldpe_l2vpn_exit(struct l2vpn *);
static struct l2vpn *conf_get_l2vpn(char *);
static struct l2vpn_if *conf_get_l2vpn_if(struct l2vpn *, struct kif *);
static struct l2vpn_pw *conf_get_l2vpn_pw(struct l2vpn *, struct kif *);
static struct l2vpn *l2vpn;
struct l2vpn *l;
static struct l2vpn *
struct l2vpn *l;
conf_get_l2vpn_if(struct l2vpn *l, struct kif *kif)
struct l2vpn *ltmp;
LIST_INSERT_HEAD(&l2vpn->if_list, f, entry);
conf_get_l2vpn_pw(struct l2vpn *l, struct kif *kif)
struct l2vpn *ltmp;
LIST_INSERT_HEAD(&l2vpn->pw_list, p, entry);
struct l2vpn *l;
| grammar l2vpn '\n'
pw = conf_get_l2vpn_pw(l2vpn, kif);
struct l2vpn *l;
l2vpn->pw_type = $2;
l2vpn->mtu = $2;
struct l2vpn *l;
if (l2vpn->br_ifindex != 0) {
"redefined on l2vpn %s", l2vpn->name);
l2vpn->br_ifindex = kif->ifindex;
strlcpy(l2vpn->br_ifname, kif->ifname,
sizeof(l2vpn->br_ifname));
lif = conf_get_l2vpn_if(l2vpn, kif);
l2vpn : L2VPN STRING TYPE l2vpn_type {
l2vpn = conf_get_l2vpn($2);
if (l2vpn == NULL)
l2vpn->type = $4;
l2vpn = NULL;
print_l2vpn(struct l2vpn *l2vpn)
printf("\nl2vpn %s type vpls {\n", l2vpn->name);
if (l2vpn->pw_type == PW_TYPE_ETHERNET)
printf("\tmtu %u\n", l2vpn->mtu);
if (l2vpn->br_ifindex != 0)
printf("\tbridge %s\n", l2vpn->br_ifname);
LIST_FOREACH(lif, &l2vpn->if_list, entry)
LIST_FOREACH(pw, &l2vpn->pw_list, entry)
struct l2vpn *l2vpn;
LIST_FOREACH(l2vpn, &conf->l2vpn_list, entry)
print_l2vpn(l2vpn);
static void print_l2vpn(struct l2vpn *);