Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ldpe_imsg_compose_lde(imsg_type, nbr->peerid, 0, &me->map,
sizeof(struct map));
ldpe_imsg_compose_lde(imsg_type, nbr->peerid, 0, &me->map,
sizeof(struct map));
TAILQ_REMOVE(&mh, me, entry);
free(me);
}
return (0);
TAILQ_REMOVE(&mh, me, entry);
free(me);
}
return (0);
mapping_list_clr(&mh);
return (-1);
mapping_list_clr(&mh);
return (-1);
break;
case MAP_TYPE_PWID:
if (map->flags & F_MAP_PW_ID)
break;
case MAP_TYPE_PWID:
if (map->flags & F_MAP_PW_ID)
- pw_len += PW_STATUS_TLV_LEN;
+ pw_len += FEC_PWID_SIZE;
if (map->flags & F_MAP_PW_IFMTU)
pw_len += FEC_SUBTLV_IFMTU_SIZE;
if (map->flags & F_MAP_PW_IFMTU)
pw_len += FEC_SUBTLV_IFMTU_SIZE;
static void lde_shutdown(void);
static int lde_dispatch_imsg(struct thread *);
static int lde_dispatch_parent(struct thread *);
static void lde_shutdown(void);
static int lde_dispatch_imsg(struct thread *);
static int lde_dispatch_parent(struct thread *);
-static __inline int lde_nbr_compare(struct lde_nbr *,
+static __inline int lde_nbr_compare(struct lde_nbr *,
struct lde_nbr *);
static struct lde_nbr *lde_nbr_new(uint32_t, struct lde_nbr *);
static void lde_nbr_del(struct lde_nbr *);
struct lde_nbr *);
static struct lde_nbr *lde_nbr_new(uint32_t, struct lde_nbr *);
static void lde_nbr_del(struct lde_nbr *);
-lde_send_notification(uint32_t peerid, uint32_t status_code, uint32_t msg_id,
+lde_send_notification(struct lde_nbr *ln, uint32_t status_code, uint32_t msg_id,
uint16_t msg_type)
{
struct notify_msg nm;
uint16_t msg_type)
{
struct notify_msg nm;
nm.msg_id = msg_id;
nm.msg_type = msg_type;
nm.msg_id = msg_id;
nm.msg_type = msg_type;
- lde_imsg_compose_ldpe(IMSG_NOTIFICATION_SEND, peerid, 0,
+ lde_imsg_compose_ldpe(IMSG_NOTIFICATION_SEND, ln->peerid, 0,
void lde_send_labelwithdraw_all(struct fec_node *, uint32_t);
void lde_send_labelrelease(struct lde_nbr *, struct fec_node *,
uint32_t);
void lde_send_labelwithdraw_all(struct fec_node *, uint32_t);
void lde_send_labelrelease(struct lde_nbr *, struct fec_node *,
uint32_t);
-void lde_send_notification(uint32_t, uint32_t, uint32_t, uint16_t);
+void lde_send_notification(struct lde_nbr *, uint32_t, uint32_t,
+ uint16_t);
struct lde_nbr *lde_nbr_find_by_lsrid(struct in_addr);
struct lde_nbr *lde_nbr_find_by_addr(int, union ldpd_addr *);
struct lde_map *lde_map_add(struct lde_nbr *, struct fec_node *, int);
struct lde_nbr *lde_nbr_find_by_lsrid(struct in_addr);
struct lde_nbr *lde_nbr_find_by_addr(int, union ldpd_addr *);
struct lde_map *lde_map_add(struct lde_nbr *, struct fec_node *, int);
fn = (struct fec_node *)fec_find(&ft, &fec);
if (fn == NULL || LIST_EMPTY(&fn->nexthops)) {
/* LRq.5: send No Route notification */
fn = (struct fec_node *)fec_find(&ft, &fec);
if (fn == NULL || LIST_EMPTY(&fn->nexthops)) {
/* LRq.5: send No Route notification */
- lde_send_notification(ln->peerid, S_NO_ROUTE, map->msg_id,
+ lde_send_notification(ln, S_NO_ROUTE, map->msg_id,
htons(MSG_TYPE_LABELREQUEST));
return;
}
htons(MSG_TYPE_LABELREQUEST));
return;
}
continue;
/* LRq.4: send Loop Detected notification */
continue;
/* LRq.4: send Loop Detected notification */
- lde_send_notification(ln->peerid, S_LOOP_DETECTED,
- map->msg_id, htons(MSG_TYPE_LABELREQUEST));
+ lde_send_notification(ln, S_LOOP_DETECTED, map->msg_id,
+ htons(MSG_TYPE_LABELREQUEST));
#define FEC_ELM_WCARD_LEN 1
#define FEC_ELM_PREFIX_MIN_LEN 4
#define FEC_PWID_ELM_MIN_LEN 8
#define FEC_ELM_WCARD_LEN 1
#define FEC_ELM_PREFIX_MIN_LEN 4
#define FEC_PWID_ELM_MIN_LEN 8
#define MAP_TYPE_WILDCARD 0x01
#define MAP_TYPE_PREFIX 0x02
#define MAP_TYPE_WILDCARD 0x01
#define MAP_TYPE_PREFIX 0x02
continue;
ictl = if_to_ctl(ia);
continue;
ictl = if_to_ctl(ia);
- imsg_compose_event(&c->iev,
- IMSG_CTL_SHOW_INTERFACE,
+ imsg_compose_event(&c->iev, IMSG_CTL_SHOW_INTERFACE,
0, 0, -1, ictl, sizeof(struct ctl_iface));
}
}
0, 0, -1, ictl, sizeof(struct ctl_iface));
}
}