misc: remove GNU Indent directives
[vpp.git] / src / vnet / ip / ip4_packet.h
index 0653092..2690491 100644 (file)
@@ -41,7 +41,6 @@
 #define included_ip4_packet_h
 
 #include <vnet/ip/ip_packet.h> /* for ip_csum_t */
-#include <vnet/tcp/tcp_packet.h>       /* for tcp_header_t */
 #include <vppinfra/byte_order.h>       /* for clib_net_to_host_u16 */
 #include <vppinfra/warnings.h> /* for WARN_OFF/WARN_ON macro */
 
@@ -130,19 +129,15 @@ typedef union
 
   /* 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. */
@@ -201,9 +196,7 @@ ip4_next_header (ip4_header_t * i)
 /* Turn off array bounds check due to ip4_header_t
    option field operations. */
 
-/* *INDENT-OFF* */
 WARN_OFF(array-bounds)
-/* *INDENT-ON* */
 
 static_always_inline u16
 ip4_header_checksum_inline (ip4_header_t * i, int with_checksum)
@@ -306,9 +299,7 @@ ip4_header_checksum_inline (ip4_header_t * i, int with_checksum)
   return ~((u16) sum);
 }
 
-/* *INDENT-OFF* */
 WARN_ON(array-bounds)
-/* *INDENT-ON* */
 
 always_inline u16
 ip4_header_checksum (ip4_header_t * i)
@@ -359,6 +350,18 @@ ip4_header_get_ecn (const ip4_header_t * ip4)
   return (ip4->tos & IP_PACKET_TC_FIELD_ECN_MASK);
 }
 
+always_inline u8
+ip4_header_get_ttl (const ip4_header_t *ip4)
+{
+  return (ip4->ttl);
+}
+
+always_inline void
+ip4_header_set_ttl (ip4_header_t *ip4, u8 ttl)
+{
+  ip4->ttl = ttl;
+}
+
 always_inline void
 ip4_header_set_df (ip4_header_t * ip4)
 {
@@ -464,47 +467,6 @@ ip4_multicast_ethernet_address (u8 * ethernet_address,
   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 */
 
 /*