aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/dpo
AgeCommit message (Expand)AuthorFilesLines
2018-12-18MFIB: recurse resolution through an MFIB entryNeale Ranns4-0/+113
2018-12-16IP6-MFIB: replace the radix tree with bihash (VPP-1526)Neale Ranns1-3/+3
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach2-3/+3
2018-11-02vlib: define minimum chained buffer segment sizeDamjan Marion1-1/+2
2018-10-23c11 safe string handling supportDave Barach8-8/+8
2018-10-16FIB: use vlib-log for debuggingNeale Ranns3-33/+39
2018-10-16Sticky Load-balanceNeale Ranns2-24/+130
2018-10-08replicate trace fixNeale Ranns1-2/+6
2018-10-01mroute routers in the stats segmentNeale Ranns1-1/+6
2018-09-20Route counters in the stats segmentNeale Ranns1-1/+10
2018-09-14BIER API and load-balancing fixesNeale Ranns1-2/+2
2018-08-30SR-MPLS: fixes and testsNeale Ranns1-1/+1
2018-08-22show command for lookup DPOsNeale Ranns1-0/+40
2018-08-03loop counter to prevent infiinte number of look ups per-packetNeale Ranns1-1/+84
2018-07-19Remove unused argument to vlib_feature_nextDamjan Marion1-6/+3
2018-07-11avoid using thread local storage for thread indexDamjan Marion1-1/+1
2018-06-26node functions cannot be always_inlineDamjan Marion1-10/+10
2018-05-26Fix interface-rx-dpo-l2 node to setup l2_len in vnet bufferJohn Lo1-4/+16
2018-05-04Harmonize vec/pool_get_aligned object sizes and alignment requestsDave Barach9-0/+53
2018-04-24memory leakKingwel Xie1-0/+3
2018-04-12Fixes for 'make UNATTENDED=yes CC=clang CXX=clang verify'Neale Ranns1-10/+1
2018-04-09DVR: save the rewrite length in packet meta-data for featuresNeale Ranns1-3/+9
2018-03-20FIB Interpose SourceNeale Ranns5-26/+114
2018-03-19Coverity found bugs in recent MPLS changesNeale Ranns2-2/+2
2018-03-19FIX: Fixed ip6_fib_dump api function response.Dmitry Vakhrushev2-0/+8
2018-03-15Add a helper function to fetch vlib node index for already stacked dposVijayabhaskar Katamreddy2-0/+40
2018-03-09MPLS Unifom modeNeale Ranns5-329/+1150
2018-03-05IP6 link-local tableNeale Ranns4-0/+245
2018-02-07Refactor vlib_buffer flagsDamjan Marion1-6/+6
2018-02-06BIER: fix support for longer bit-string lengthsNeale Ranns1-1/+2
2018-01-09DVR: run L3 output featuresNeale Ranns6-436/+661
2017-12-20L2 EmulationNeale Ranns1-1/+1
2017-12-09BIER in non-MPLS netowrksNeale Ranns2-0/+11
2017-12-06Label stack size exceeded fixNeale Ranns2-1/+19
2017-11-14NULL-terminate load_balance_nsh_nodes[]Gabriel Ganne1-0/+1
2017-11-09BIERNeale Ranns5-12/+86
2017-11-03NAT64: Input feature arc on virtual interface via interface RX DPO.Ole Troan2-2/+2
2017-10-31Refactor IP input checks for re-use at MPLS dispositionNeale Ranns1-20/+54
2017-10-25L3 proxy FIB source for container networkingAndrew Yourtchenko4-3/+270
2017-10-14change format_get_indent() to use u32 instead of uwordGabriel Ganne1-1/+1
2017-10-14Source Lookup progammable via APINeale Ranns1-2/+2
2017-10-05Distributed Virtual Router SupportNeale Ranns4-1/+436
2017-10-04[aarch64] Fixes CLI crashes on dpaa2 platform.Christophe Fontaine5-8/+8
2017-09-11FIB table add/delete APINeale Ranns2-8/+24
2017-08-21PPPoE usses a midchain adjacency stack on an interface-tx DPONeale Ranns7-506/+670
2017-08-08L2 over MPLSNeale Ranns4-9/+96
2017-06-30VPP debug image with worker threads hit assert on adding IP route with traffi...Neale Ranns1-1/+16
2017-05-26MPLS lookup DPO does not pop the label (nor does it handle replicate)Neale Ranns1-6/+41
2017-05-25MPLS hash function improvementsNeale Ranns1-1/+1
2017-05-24Missing VLIB node for IPv6 disposition from mcast MPLS LSPNeale Ranns1-1/+23
n class="k">goto done; case 0x00: result += 0; goto done; default: /* Not a valid netmask mask. */ return ~0; } } done: return result; } typedef union { struct { /* 4 bit packet length (in 32bit units) and version VVVVLLLL. e.g. for packets w/ no options ip_version_and_header_length == 0x45. */ u8 ip_version_and_header_length; /* Type of service. */ u8 tos; /* Total layer 3 packet length including this header. */ u16 length; /* Fragmentation ID. */ u16 fragment_id; /* 3 bits of flags and 13 bits of fragment offset (in units of 8 byte quantities). */ u16 flags_and_fragment_offset; #define IP4_HEADER_FLAG_MORE_FRAGMENTS (1 << 13) #define IP4_HEADER_FLAG_DONT_FRAGMENT (1 << 14) #define IP4_HEADER_FLAG_CONGESTION (1 << 15) /* Time to live decremented by router at each hop. */ u8 ttl; /* Next level protocol packet. */ u8 protocol; /* Checksum. */ u16 checksum; /* Source and destination address. */ union { struct { ip4_address_t src_address, dst_address; }; ip4_address_pair_t address_pair; }; }; /* For checksumming we'll want to access IP header in word sized chunks. */ /* For 64 bit machines. */ /* *INDENT-OFF* */ CLIB_PACKED (struct { u64 checksum_data_64[2]; u32 checksum_data_64_32[1]; }); /* *INDENT-ON* */ /* For 32 bit machines. */ /* *INDENT-OFF* */ CLIB_PACKED (struct { u32 checksum_data_32[5]; }); /* *INDENT-ON* */ } ip4_header_t; /* Value of ip_version_and_header_length for packets w/o options. */ #define IP4_VERSION_AND_HEADER_LENGTH_NO_OPTIONS \ ((4 << 4) | (sizeof (ip4_header_t) / sizeof (u32))) #define IP4_ROUTER_ALERT_OPTION 20 always_inline int ip4_get_fragment_offset (const ip4_header_t * i) { return clib_net_to_host_u16 (i->flags_and_fragment_offset) & 0x1fff; } always_inline int ip4_get_fragment_more (const ip4_header_t * i) { return clib_net_to_host_u16 (i->flags_and_fragment_offset) & IP4_HEADER_FLAG_MORE_FRAGMENTS; } always_inline int ip4_is_fragment (const ip4_header_t * i) { return (i->flags_and_fragment_offset & clib_net_to_host_u16 (0x1fff | IP4_HEADER_FLAG_MORE_FRAGMENTS)); } always_inline int ip4_is_first_fragment (const ip4_header_t * i) { return (i->flags_and_fragment_offset & clib_net_to_host_u16 (0x1fff | IP4_HEADER_FLAG_MORE_FRAGMENTS)) == clib_net_to_host_u16 (IP4_HEADER_FLAG_MORE_FRAGMENTS); } /* Fragment offset in bytes. */ always_inline int ip4_get_fragment_offset_bytes (const ip4_header_t * i) { return 8 * ip4_get_fragment_offset (i); } always_inline int ip4_header_bytes (const ip4_header_t * i) { return sizeof (u32) * (i->ip_version_and_header_length & 0xf); } always_inline void * ip4_next_header (ip4_header_t * i) { return (void *) i + ip4_header_bytes (i); } always_inline u16 ip4_header_checksum (ip4_header_t * i) { u16 save, csum; ip_csum_t sum; save = i->checksum; i->checksum = 0; sum = ip_incremental_checksum (0, i, ip4_header_bytes (i)); csum = ~ip_csum_fold (sum); i->checksum = save; /* Make checksum agree for special case where either 0 or 0xffff would give same 1s complement sum. */ if (csum == 0 && save == 0xffff) csum = save; return csum; } static inline uword ip4_header_checksum_is_valid (ip4_header_t * i) { return i->checksum == ip4_header_checksum (i); } #define ip4_partial_header_checksum_x1(ip0,sum0) \ do { \ if (BITS (ip_csum_t) > 32) \ { \ sum0 = ip0->checksum_data_64[0]; \ sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_64[1]); \ sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_64_32[0]); \ } \ else \ { \ sum0 = ip0->checksum_data_32[0]; \ sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_32[1]); \ sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_32[2]); \ sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_32[3]); \ sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_32[4]); \ } \ } while (0) #define ip4_partial_header_checksum_x2(ip0,ip1,sum0,sum1) \ do { \ if (BITS (ip_csum_t) > 32) \ { \ sum0 = ip0->checksum_data_64[0]; \ sum1 = ip1->checksum_data_64[0]; \ sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_64[1]); \ sum1 = ip_csum_with_carry (sum1, ip1->checksum_data_64[1]); \ sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_64_32[0]); \ sum1 = ip_csum_with_carry (sum1, ip1->checksum_data_64_32[0]); \ } \ else \ { \ sum0 = ip0->checksum_data_32[0]; \ sum1 = ip1->checksum_data_32[0]; \ sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_32[1]); \ sum1 = ip_csum_with_carry (sum1, ip1->checksum_data_32[1]); \ sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_32[2]); \ sum1 = ip_csum_with_carry (sum1, ip1->checksum_data_32[2]); \ sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_32[3]); \ sum1 = ip_csum_with_carry (sum1, ip1->checksum_data_32[3]); \ sum0 = ip_csum_with_carry (sum0, ip0->checksum_data_32[4]); \ sum1 = ip_csum_with_carry (sum1, ip1->checksum_data_32[4]); \ } \ } while (0) always_inline uword ip4_address_is_multicast (const ip4_address_t * a) { return (a->data[0] & 0xf0) == 0xe0; } always_inline void ip4_multicast_address_set_for_group (ip4_address_t * a, ip_multicast_group_t g) { ASSERT ((u32) g < (1 << 28)); a->as_u32 = clib_host_to_net_u32 ((0xe << 28) + g); } always_inline void ip4_multicast_ethernet_address (u8 * ethernet_address, const ip4_address_t * a) { const u8 *d = a->as_u8; ethernet_address[0] = 0x01; ethernet_address[1] = 0x00; ethernet_address[2] = 0x5e; ethernet_address[3] = d[1] & 0x7f; ethernet_address[4] = d[2]; ethernet_address[5] = d[3]; } always_inline void ip4_tcp_reply_x1 (ip4_header_t * ip0, tcp_header_t * tcp0) { u32 src0, dst0; src0 = ip0->src_address.data_u32; dst0 = ip0->dst_address.data_u32; ip0->src_address.data_u32 = dst0; ip0->dst_address.data_u32 = src0; src0 = tcp0->src; dst0 = tcp0->dst; tcp0->src = dst0; tcp0->dst = src0; } always_inline void ip4_tcp_reply_x2 (ip4_header_t * ip0, ip4_header_t * ip1, tcp_header_t * tcp0, tcp_header_t * tcp1) { u32 src0, dst0, src1, dst1; src0 = ip0->src_address.data_u32; src1 = ip1->src_address.data_u32; dst0 = ip0->dst_address.data_u32; dst1 = ip1->dst_address.data_u32; ip0->src_address.data_u32 = dst0; ip1->src_address.data_u32 = dst1; ip0->dst_address.data_u32 = src0; ip1->dst_address.data_u32 = src1; src0 = tcp0->src; src1 = tcp1->src; dst0 = tcp0->dst; dst1 = tcp1->dst; tcp0->src = dst0; tcp1->src = dst1; tcp0->dst = src0; tcp1->dst = src1; } #endif /* included_ip4_packet_h */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */