aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/trace.h
AgeCommit message (Expand)AuthorFilesLines
2023-07-25classify: add bpf support to pcap classifierMaxime Peim1-1/+1
2023-06-30vlib: introduce trace filter functionsMohammed Hawari1-0/+37
2020-12-15classify: add pcap/trace classfier mgmt API callsJon Loeliger1-0/+1
2020-11-04vlib: add postmortem pcap dispatch traceDave Barach1-0/+1
2020-10-06feature: Add packet trace APIJon Loeliger1-0/+6
2020-07-16misc: add tracedump API pluginDave Barach1-0/+2
2019-05-03Add callbacks for extended trace functionality, one as content is added with ...Gary Boon1-0/+21
2018-11-20Add buffer tracing to the dispatch tracerDave Barach1-0/+2
2018-08-24Clean up packet tracer, especially "clear trace"Dave Barach1-1/+1
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion1-0/+100
ff } /* Literal.String.Escape */ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * tunnel.h: shared definitions for tunnels.
 *
 * Copyright (c) 2019 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __TUNNEL_H__
#define __TUNNEL_H__

#include <vnet/ip/ip_types.h>
#include <vnet/fib/fib_node.h>

#define foreach_tunnel_mode     \
  _(P2P, "point-to-point")      \
  _(MP, "multi-point")          \

typedef enum tunnel_mode_t_
{
#define _(n, s) TUNNEL_MODE_##n,
  foreach_tunnel_mode
#undef _
} __clib_packed tunnel_mode_t;

extern u8 *format_tunnel_mode (u8 * s, va_list * args);
extern uword unformat_tunnel_mode (unformat_input_t * input, va_list * args);

/**
 * Keep these idenitical to those in ipip.api
 */
#define foreach_tunnel_encap_decap_flag                                       \
  _ (NONE, "none", 0x0)                                                       \
  _ (ENCAP_COPY_DF, "encap-copy-df", 0x1)                                     \
  _ (ENCAP_SET_DF, "encap-set-df", 0x2)                                       \
  _ (ENCAP_COPY_DSCP, "encap-copy-dscp", 0x4)                                 \
  _ (ENCAP_COPY_ECN, "encap-copy-ecn", 0x8)                                   \
  _ (DECAP_COPY_ECN, "decap-copy-ecn", 0x10)                                  \
  _ (ENCAP_INNER_HASH, "encap-inner-hash", 0x20)                              \
  _ (ENCAP_COPY_HOP_LIMIT, "encap-copy-hop-limit", 0x40)                      \
  _ (ENCAP_COPY_FLOW_LABEL, "encap-copy-flow-label", 0x80)

typedef enum tunnel_encap_decap_flags_t_
{
#define _(a,b,c) TUNNEL_ENCAP_DECAP_FLAG_##a = c,
  foreach_tunnel_encap_decap_flag
#undef _
} __clib_packed tunnel_encap_decap_flags_t;

extern const u8 TUNNEL_ENCAP_DECAP_FLAG_MASK;

extern u8 *format_tunnel_encap_decap_flags (u8 * s, va_list * args);
extern uword unformat_tunnel_encap_decap_flags (unformat_input_t *input,
						va_list *args);

#define foreach_tunnel_flag                                                   \
  _ (RESOLVED, 0, "resolved")                                                 \
  _ (TRACK_MTU, 1, "track-mtu")

typedef enum tunnel_flags_t_
{
  TUNNEL_FLAG_NONE = 0,
#define _(n, b, s) TUNNEL_FLAG_##n = (1 << b),
  foreach_tunnel_flag
#undef _
} __clib_packed tunnel_flags_t;

extern const u8 TUNNEL_FLAG_MASK;

extern u8 *format_tunnel_flags (u8 *s, va_list *args);
extern uword unformat_tunnel_flags (unformat_input_t *input, va_list *args);

/**
 * A representation of an IP tunnel config
 */
typedef struct tunnel_t_
{
  ip_address_t t_src;
  ip_address_t t_dst;
  tunnel_encap_decap_flags_t t_encap_decap_flags;
  tunnel_flags_t t_flags;
  tunnel_mode_t t_mode;
  u32 t_table_id;
  ip_dscp_t t_dscp;
  u8 t_hop_limit;

  /**
   * derived data
   */
  u32 t_fib_index;

  fib_node_index_t t_fib_entry_index;
  u32 t_sibling;

} tunnel_t;

extern u8 *format_tunnel (u8 *s, va_list *args);
extern uword unformat_tunnel (unformat_input_t *input, va_list *args);

extern void tunnel_copy (const tunnel_t *src, tunnel_t *dst);
extern int tunnel_resolve (tunnel_t *t, fib_node_type_t child_type,
			   index_t child_index);
extern void tunnel_unresolve (tunnel_t *t);

extern ip_address_family_t tunnel_get_af (const tunnel_t *t);

extern void tunnel_contribute_forwarding (const tunnel_t *t, dpo_id_t *dpo);

extern void tunnel_build_v6_hdr (const tunnel_t *t, ip_protocol_t next_proto,
				 ip6_header_t *ip);
extern void tunnel_build_v4_hdr (const tunnel_t *t, ip_protocol_t next_proto,
				 ip4_header_t *ip);

#endif

/*
 * fd.io coding-style-patch-verification: ON
 *
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */