Skip to content

Commit

Permalink
Combine streams of configured L4 protocol, port into a single stream
Browse files Browse the repository at this point in the history
Change-Id: Iaf6b5ae27fec9d58e60852aee267aacb875a773f
Partial-BUG: 1518234
  • Loading branch information
anandhk-juniper committed Dec 15, 2015
1 parent 4ee746e commit 542d299
Show file tree
Hide file tree
Showing 14 changed files with 613 additions and 10 deletions.
13 changes: 13 additions & 0 deletions dp-core/vr_bitmap.c
Expand Up @@ -78,6 +78,19 @@ vr_bitmap_get_first_free_bit(vr_bmap_t b)
return -1;
}

bool
vr_bitmap_is_set_bit(vr_bmap_t b, unsigned int bit)
{
unsigned int bit_data;
struct vr_bitmap *bmap = (struct vr_bitmap *)b;

bit_data = bmap->bmap_data[(bit / 8)];
if (bit_data & (1 << (bit % 8)))
return true;

return false;
}

bool
vr_bitmap_clear_bit(vr_bmap_t b, unsigned int bit)
{
Expand Down
21 changes: 21 additions & 0 deletions dp-core/vr_flow.c
Expand Up @@ -1225,6 +1225,27 @@ __vr_flow_forward(flow_result_t result, struct vr_packet *pkt,
return forward;
}

fat_flow_port_mask_t
vr_flow_fat_flow_lookup(struct vrouter *router, struct vr_packet *pkt,
uint16_t l4_proto, uint16_t sport, uint16_t dport)
{
struct vr_nexthop *nh;
struct vr_interface *vif_l = NULL;

if (vif_is_virtual(pkt->vp_if)) {
vif_l = pkt->vp_if;
} else if (vif_is_fabric(pkt->vp_if)) {
if ((nh = pkt->vp_nh) && (nh->nh_flags & NH_FLAG_VALID)) {
vif_l = nh->nh_dev;
}
}

if (!vif_l)
return NO_PORT_MASK;

return vif_fat_flow_lookup(vif_l, l4_proto, sport, dport);
}

static flow_result_t
vr_do_flow_lookup(struct vrouter *router, struct vr_packet *pkt,
struct vr_forwarding_md *fmd)
Expand Down

0 comments on commit 542d299

Please sign in to comment.