summaryrefslogtreecommitdiffstats
path: root/src/vnet/pg/example.script
blob: 0e29b9ecae6e563acf70778d0177aea729d67f45 (plain)
1
2
3
4
5
6
packet-generator new {
  name x
  limit 1
  node ethernet-input
  data { IP: 1.2.3 -> 4.5.6 incrementing 100 }
}
ing.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 */ }
/*
 * Copyright (c) 2011-2016 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 __included_bfd_protocol_h__
#define __included_bfd_protocol_h__
/**
 * @file
 * @brief BFD protocol declarations
 */

#include <vppinfra/types.h>
#include <vppinfra/clib.h>

/* auth type value, max key length, name, description */
#define foreach_bfd_auth_type(F)                          \
  F (0, 0, reserved, "Reserved")                          \
  F (1, 16, simple_password, "Simple Password")           \
  F (2, 16, keyed_md5, "Keyed MD5")                       \
  F (3, 16, meticulous_keyed_md5, "Meticulous Keyed MD5") \
  F (4, 20, keyed_sha1, "Keyed SHA1")                     \
  F (5, 20, meticulous_keyed_sha1, "Meticulous Keyed SHA1")

#define BFD_AUTH_TYPE_NAME(t) BFD_AUTH_TYPE_##t

typedef enum
{
#define F(n, l, t, s) BFD_AUTH_TYPE_NAME (t) = n,
  foreach_bfd_auth_type (F)
#undef F
} bfd_auth_type_e;

/**
 * @brief get the maximum length of key data for given auth type
 */
u32 bfd_max_key_len_for_auth_type (bfd_auth_type_e auth_type);
const char *bfd_auth_type_str (bfd_auth_type_e auth_type);

/* *INDENT-OFF* */
typedef CLIB_PACKED (struct {
  u8 type;
  u8 len;
}) bfd_auth_common_t;
/* *INDENT-ON* */

/* *INDENT-OFF* */
typedef CLIB_PACKED (struct {
  /*
   * 4.4.  Keyed SHA1 and Meticulous Keyed SHA1 Authentication Section Format

   *     If the Authentication Present (A) bit is set in the header, and the
   *     Authentication Type field contains 4 (Keyed SHA1) or 5 (Meticulous
   *     Keyed SHA1), the Authentication Section has the following format:

   *      0                   1                   2                   3
   *      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   *     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   *     |   Auth Type   |   Auth Len    |  Auth Key ID  |   Reserved    |
   *     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   *     |                        Sequence Number                        |
   *     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   *     |                       Auth Key/Hash...                        |
   *     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   *     |                              ...                              |
   *     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   */
  bfd_auth_common_t type_len;
  u8 key_id;
  u8 reserved;
  u32 seq_num;
  /*
   *  Auth Key/Hash

   *     This field carries the 20-byte SHA1 hash for the packet.  When the
   *     hash is calculated, the shared SHA1 key is stored in this field,
   *     padded to a length of 20 bytes with trailing zero bytes if needed.
   *     The shared key MUST be encoded and configured to section 6.7.4.
   */
  u8 hash[20];
}) bfd_auth_sha1_t;
/* *INDENT-ON* */

/* *INDENT-OFF* */
typedef CLIB_PACKED (struct {
  /*
   *  The Mandatory Section of a BFD Control packet has the following
   *  format:

   *   0                   1                   2                   3
   *   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   *  |Vers |  Diag   |Sta|P|F|C|A|D|M|  Detect Mult  |    Length     |
   *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   *  |                       My Discriminator                        |
   *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   *  |                      Your Discriminator                       |
   *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   *  |                    Desired Min TX Interval                    |
   *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   *  |                   Required Min RX Interval                    |
   *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   *  |                 Required Min Echo RX Interval                 |
   *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   */
  struct
  {
    u8 vers_diag;
    u8 sta_flags;
    u8 detect_mult;
    u8 length;
  } head;
  u32 my_disc;
  u32 your_disc;
  u32 des_min_tx;
  u32 req_min_rx;
  u32 req_min_echo_rx;
}) bfd_pkt_t;
/* *INDENT-ON* */

/* *INDENT-OFF* */
typedef CLIB_PACKED (struct {
  bfd_pkt_t pkt;
  bfd_auth_common_t common_auth;
}) bfd_pkt_with_common_auth_t;
/* *INDENT-ON* */

/* *INDENT-OFF* */
typedef CLIB_PACKED (struct {
  bfd_pkt_t pkt;
  bfd_auth_sha1_t sha1_auth;
}) bfd_pkt_with_sha1_auth_t;
/* *INDENT-ON* */

u8 bfd_pkt_get_version (const bfd_pkt_t * pkt);
void bfd_pkt_set_version (bfd_pkt_t * pkt, int version);
u8 bfd_pkt_get_diag_code (const bfd_pkt_t * pkt);
void bfd_pkt_set_diag_code (bfd_pkt_t * pkt, int value);
u8 bfd_pkt_get_state (const bfd_pkt_t * pkt);
void bfd_pkt_set_state (bfd_pkt_t * pkt, int value);
u8 bfd_pkt_get_poll (const bfd_pkt_t * pkt);
void bfd_pkt_set_final (bfd_pkt_t * pkt);
u8 bfd_pkt_get_final (const bfd_pkt_t * pkt);
void bfd_pkt_set_poll (bfd_pkt_t * pkt);
u8 bfd_pkt_get_control_plane_independent (const bfd_pkt_t * pkt);
void bfd_pkt_set_control_plane_independent (bfd_pkt_t * pkt);
u8 bfd_pkt_get_auth_present (const bfd_pkt_t * pkt);
void bfd_pkt_set_auth_present (bfd_pkt_t * pkt);
u8 bfd_pkt_get_demand (const bfd_pkt_t * pkt);
void bfd_pkt_set_demand (bfd_pkt_t * pkt);
u8 bfd_pkt_get_multipoint (const bfd_pkt_t * pkt);
void bfd_pkt_set_multipoint (bfd_pkt_t * pkt);

/* BFD diagnostic codes */
#define foreach_bfd_diag_code(F)                             \
  F (0, no_diag, "No Diagnostic")                            \
  F (1, det_time_exp, "Control Detection Time Expired")      \
  F (2, echo_failed, "Echo Function Failed")                 \
  F (3, neighbor_sig_down, "Neighbor Signaled Session Down") \
  F (4, fwd_plain_reset, "Forwarding Plane Reset")           \
  F (5, path_down, "Path Down")                              \
  F (6, concat_path_down, "Concatenated Path Down")          \
  F (7, admin_down, "Administratively Down")                 \
  F (8, reverse_concat_path_down, "Reverse Concatenated Path Down")

#define BFD_DIAG_CODE_NAME(t) BFD_DIAG_CODE_##t

typedef enum
{
#define F(n, t, s) BFD_DIAG_CODE_NAME (t) = n,
  foreach_bfd_diag_code (F)
#undef F
} bfd_diag_code_e;

const char *bfd_diag_code_string (bfd_diag_code_e diag);

/* BFD state values */
#define foreach_bfd_state(F)     \
  F (0, admin_down, "AdminDown") \
  F (1, down, "Down")            \
  F (2, init, "Init")            \
  F (3, up, "Up")

#define BFD_STATE_NAME(t) BFD_STATE_##t

typedef enum
{
#define F(n, t, s) BFD_STATE_NAME (t) = n,
  foreach_bfd_state (F)
#undef F
} bfd_state_e;

const char *bfd_state_string (bfd_state_e state);

#endif /* __included_bfd_protocol_h__ */

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