summaryrefslogtreecommitdiffstats
path: root/.git_commit_template.txt
blob: d81587cdfcabded014c4ef9db95bd24cf9833ec5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# <feature-name>: <subject>
# |<----  Using a maximum of 50 characters  ---->|
#
# Explain why this change is being made
# |<----   Try to limit each line to a maximum of 72 characters   ---->|

# Ticket: <JIRA #id>
# Type: <type>
# Fixes: <offending-git-commit-id>
# Change-Id: <sha1>
# Signed-off-by: <email>
#
#
# --- COMMIT END ---
#
# Type can be
#    feature     (new feature)
#    fix         (bug fix)
#    refactor    (refactoring production code)
#    improvement (minor improvements in existing feature)
#    style       (formatting, missing semi colons, etc; no code change)
#    docs        (changes to documentation)
#    test        (adding or refactoring tests; no production code change)
#    make        (change the build process, or tools, or infrastructure)
#
# feature-name: Is the name of the VPP feature, plugin or directory.
#               Commits across multiple components should be split.
#               E.g. ip, fib, nat, acl, host, api
#
# Fixes: If type is fix refers to the original commit (optional).
# Ticket: Refers to JIRA ticket if it exists (optional).
#
# --------------------
# Remember to:
#    Lowercase the subject line.
#    Use the imperative mood in the subject line.
#    Not end the subject line with a period.
#    Separate subject from body with a blank line.
#    Use the body to explain what and why vs. how.
#    Use multiple lines with "-" for bullet points in body.
# --------------------
# Usage:
#
# The template is automatically added to the current repository by
# make install-dep.
# (git config commit.template .git_commit_template.txt)
#
# --------------------
.ge { font-style: italic } /* Generic.Emph */ .highlight .gi { color: #a6e22e } /* Generic.Inserted */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #75715e } /* Generic.Subheading */ .highlight .kc { color: #66d9ef } /* Keyword.Constant */ .highlight .kd { color: #66d9ef } /* Keyword.Declaration */ .highlight .kn { color: #f92672 } /* Keyword.Namespace */ .highlight .kp { color: #66d9ef } /* Keyword.Pseudo */ .highlight .kr { color: #66d9ef } /* Keyword.Reserved */ .highlight .kt { color: #66d9ef } /* Keyword.Type */ .highlight .ld { color: #e6db74 } /* Literal.Date */ .highlight .m { color: #ae81ff } /* Literal.Number */ .highlight .s { color: #e6db74 } /* Literal.String */ .highlight .na { color: #a6e22e } /* Name.Attribute */ .highlight .nb { color: #f8f8f2 } /* Name.Builtin */ .highlight .nc { color: #a6e22e } /* Name.Class */ .highlight .no { color: #66d9ef } /* Name.Constant */ .highlight .nd { color: #a6e22e } /* Name.Decorator */ .highlight .ni { color: #f8f8f2 } /* Name.Entity */ .highlight .ne { color: #a6e22e } /* Name.Exception */ .highlight .nf { color: #a6e22e } /* Name.Function */ .highlight .nl { color: #f8f8f2 } /* Name.Label */ .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ .highlight .nx { color: #a6e22e } /* Name.Other */ .highlight .py { color: #f8f8f2 } /* Name.Property */ .highlight .nt { color: #f92672 } /* Name.Tag */ .highlight .nv { color: #f8f8f2 } /* Name.Variable */ .highlight .ow { color: #f92672 } /* Operator.Word */ .highlight .w { color: #f8f8f2 } /* Text.Whitespace */ .highlight .mb { color: #ae81ff } /* Literal.Number.Bin */ .highlight .mf { color: #ae81ff } /* Literal.Number.Float */ .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ .highlight .sa { color: #e6db74 } /* Literal.String.Affix */ .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ .highlight .sc { color: #e6db74 } /* Literal.String.Char */ .highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */ .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ .highlight .se { color: #ae81ff } /* 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 */ }
/*
 * 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 __GBP_API_PRINT_H__
#define __GBP_API_PRINT_H__

#include <vpp/api/types.h>

/* Macro to finish up custom dump fns */
#define PRINT_S \
    vec_add1 (s, 0);                            \
    vl_print (handle, (char *)s);               \
    vec_free (s);

static inline void *
vl_api_gbp_bridge_domain_add_t_print (vl_api_gbp_bridge_domain_add_t * a,
				      void *handle)
{
  u8 *s = 0;

  s = format (s, "SCRIPT: gbp_bridge_domain_add ");
  s = format (s, "bd_id %d ", ntohl (a->bd.bd_id));
  s = format (s, "rd_id %d ", ntohl (a->bd.rd_id));
  s = format (s, "flags %d ", ntohl (a->bd.flags));
  s = format (s, "uu-fwd %d ", ntohl (a->bd.uu_fwd_sw_if_index));
  s = format (s, "bvi %d ", ntohl (a->bd.bvi_sw_if_index));
  s = format (s, "bm-flood %d", ntohl (a->bd.bm_flood_sw_if_index));

  s = format (s, "\n");

  PRINT_S;

  return handle;
}

static inline void *
vl_api_gbp_bridge_domain_del_t_print (vl_api_gbp_bridge_domain_del_t * a,
				      void *handle)
{
  u8 *s = 0;

  s = format (s, "SCRIPT: gbp_bridge_domain_del ");
  s = format (s, "bd_id %d ", ntohl (a->bd_id));

  s = format (s, "\n");

  PRINT_S;

  return handle;
}

static inline void *
vl_api_gbp_route_domain_add_t_print (vl_api_gbp_route_domain_add_t * a,
				     void *handle)
{
  u8 *s = 0;

  s = format (s, "SCRIPT: gbp_route_domain_add ");
  s = format (s, "rd_id %d ", ntohl (a->rd.rd_id));
  s = format (s, "ip4_table_id %d ", ntohl (a->rd.ip4_table_id));
  s = format (s, "ip6_table_id %d ", ntohl (a->rd.ip6_table_id));
  s = format (s, "ip4_uu_sw_if_index %d ", ntohl (a->rd.ip4_uu_sw_if_index));
  s = format (s, "ip6_uu_sw_if_index %d", ntohl (a->rd.ip6_uu_sw_if_index));

  s = format (s, "\n");

  PRINT_S;

  return handle;
}

static inline void *
vl_api_gbp_route_domain_del_t_print (vl_api_gbp_route_domain_del_t * a,
				     void *handle)
{
  u8 *s = 0;

  s = format (s, "SCRIPT: gbp_route_domain_del ");
  s = format (s, "rd_id %d", ntohl (a->rd_id));

  s = format (s, "\n");

  PRINT_S;

  return handle;
}

static inline void *
vl_api_gbp_endpoint_add_t_print (vl_api_gbp_endpoint_add_t * a, void *handle)
{
  u8 *s = 0;

  s = format (s, "SCRIPT: gbp_endpoint_add ");
  s = format (s, "sw_if_index %d ", ntohl (a->endpoint.sw_if_index));
  s = format (s, "sclass %d ", ntohs (a->endpoint.sclass));
  s = format (s, "flags %x ", ntohl (a->endpoint.flags));
  s = format (s, "mac %U ", format_vl_api_mac_address, a->endpoint.mac);
  s =
    format (s, "\n\ttun\n\t\t src %U", format_vl_api_address,
	    &a->endpoint.tun.src);
  s =
    format (s, "\n\t\t dst %U ", format_vl_api_address, &a->endpoint.tun.dst);

  if (a->endpoint.n_ips)
    s = format (s, "\n\t ips");
  for (int i = 0; i < a->endpoint.n_ips; i++)
    s = format (s, "\n\t\t %U", format_vl_api_address, &a->endpoint.ips[i]);

  s = format (s, "\n");

  PRINT_S;

  return handle;
}

static inline void *
vl_api_gbp_endpoint_del_t_print (vl_api_gbp_endpoint_del_t * a, void *handle)
{
  u8 *s = 0;

  s = format (s, "SCRIPT: gbp_endpoint_del ");
  s = format (s, "handle %d", ntohl (a->handle));

  s = format (s, "\n");

  PRINT_S;

  return handle;
}

static inline void *
vl_api_gbp_endpoint_group_add_t_print (vl_api_gbp_endpoint_group_add_t * a,
				       void *handle)
{
  u8 *s = 0;

  s = format (s, "SCRIPT: gbp_endpoint_group_add ");
  s = format (s, "vnid %d ", ntohl (a->epg.vnid));
  s = format (s, "sclass %d ", ntohs (a->epg.sclass));
  s = format (s, "bd_id %d ", ntohl (a->epg.bd_id));
  s = format (s, "rd_id %d ", ntohl (a->epg.rd_id));
  s = format (s, "uplink_sw_if_index %d ", ntohl (a->epg.uplink_sw_if_index));
  s =
    format (s, "remote_ep_timeout %d",
	    ntohl (a->epg.retention.remote_ep_timeout));

  s = format (s, "\n");

  PRINT_S;

  return handle;
}

static inline void *
vl_api_gbp_endpoint_group_del_t_print (vl_api_gbp_endpoint_group_del_t * a,
				       void *handle)
{
  u8 *s = 0;

  s = format (s, "SCRIPT: gbp_endpoint_group_del ");
  s = format (s, "sclass %d ", ntohs (a->sclass));

  s = format (s, "\n");

  PRINT_S;

  return handle;
}

static inline void *
vl_api_gbp_recirc_add_del_t_print (vl_api_gbp_recirc_add_del_t * a,
				   void *handle)
{
  u8 *s = 0;

  s = format (s, "SCRIPT: gbp_recirc_add_del ");

  if (a->is_add)
    s = format (s, "add ");
  else
    s = format (s, "del ");
  s = format (s, "sw_if_index %d ", ntohl (a->recirc.sw_if_index));
  s = format (s, "sclass %d ", ntohs (a->recirc.sclass));
  s = format (s, "is_ext %d ", a->recirc.is_ext);

  s = format (s, "\n");

  PRINT_S;

  return handle;
}

static inline void *
vl_api_gbp_subnet_add_del_t_print (vl_api_gbp_subnet_add_del_t * a,
				   void *handle)
{
  u8 *s = 0;

  s = format (s, "SCRIPT: gbp_subnet_add_del ");
  if (a->is_add)
    s = format (s, "add ");
  else
    s = format (s, "del ");
  s = format (s, "rd_id %d ", ntohl (a->subnet.rd_id));
  s = format (s, "sw_if_index %d ", ntohl (a->subnet.sw_if_index));
  s = format (s, "sclass %d ", ntohs (a->subnet.sclass));
  s = format (s, "type %d ", ntohl (a->subnet.type));
  s =
    format (s, "prefix %U/%d", format_vl_api_address,
	    &a->subnet.prefix.address, a->subnet.prefix.len);

  s = format (s, "\n");

  PRINT_S;

  return handle;
}

static inline void *
vl_api_gbp_contract_add_del_t_print (vl_api_gbp_contract_add_del_t * a,
				     void *handle)
{
  u8 *s = 0;

  s = format (s, "SCRIPT: gbp_contract_add_del ");
  if (a->is_add)
    s = format (s, "add ");
  else
    s = format (s, "del ");
  s = format (s, "scope %d ", ntohl (a->contract.scope));
  s = format (s, "sclass %d ", ntohs (a->contract.sclass));
  s = format (s, "dclass %d ", ntohs (a->contract.dclass));
  s = format (s, "acl_index %d \n", ntohl (a->contract.acl_index));
  for (int i = 0; i < a->contract.n_rules; i++)
    {
      s = format (s, "\t action %d\n", ntohl (a->contract.rules[i].action));
      s =
	format (s, "\t hash_mode %d",
		ntohl (a->contract.rules[i].nh_set.hash_mode));
      for (int j = 0; j < a->contract.rules[i].nh_set.n_nhs; j++)
	{
	  s =
	    format (s, "\n\t \t nhs ip %U ", format_vl_api_address,
		    &a->contract.rules[i].nh_set.nhs[j].ip);
	  s =
	    format (s, "nhs mac %U ", format_vl_api_mac_address,
		    a->contract.rules[i].nh_set.nhs[j].mac);
	  s =
	    format (s, "nhs bd_id %d ",
		    ntohl (a->contract.rules[i].nh_set.nhs[j].bd_id));
	  s =
	    format (s, "nhs rd_id %d",
		    ntohl (a->contract.rules[i].nh_set.nhs[j].rd_id));
	}
      s = format (s, "\n");
    }

  if (a->contract.n_ether_types)
    s = format (s, "\tethertypes");
  for (int i = 0; i < a->contract.n_ether_types; i++)
    {
      s = format (s, " %d ", ntohs (a->contract.allowed_ethertypes[i]));
    }

  s = format (s, "\n");

  PRINT_S;

  return handle;
}

static inline void *
vl_api_gbp_vxlan_tunnel_add_t_print (vl_api_gbp_vxlan_tunnel_add_t * a,
				     void *handle)
{
  u8 *s = 0;

  s = format (s, "SCRIPT: gbp_vxlan_tunnel_add ");

  s = format (s, "vni %d ", ntohl (a->tunnel.vni));
  s = format (s, "mode %d ", ntohl (a->tunnel.mode));
  s = format (s, "bd_rd_id %d ", ntohl (a->tunnel.bd_rd_id));
  s = format (s, "src %U ", format_vl_api_ip4_address, a->tunnel.src);

  s = format (s, "\n");

  PRINT_S;

  return handle;
}

static inline void *
vl_api_gbp_vxlan_tunnel_del_t_print (vl_api_gbp_vxlan_tunnel_del_t * a,
				     void *handle)
{
  u8 *s = 0;

  s = format (s, "SCRIPT: gbp_vxlan_tunnel_del ");
  s = format (s, "vni %d ", ntohl (a->vni));

  s = format (s, "\n");

  PRINT_S;

  return handle;
}

static inline void *
vl_api_gbp_ext_itf_add_del_t_print (vl_api_gbp_ext_itf_add_del_t * a,
				    void *handle)
{
  u8 *s = 0;

  s = format (s, "SCRIPT: gbp_ext_itf_add_del ");
  if (a->is_add)
    s = format (s, "add ");
  else
    s = format (s, "del ");

  s = format (s, "sw_if_index %d ", ntohl (a->ext_itf.sw_if_index));
  s = format (s, "bd_id %d ", ntohl (a->ext_itf.bd_id));
  s = format (s, "rd_id %d ", ntohl (a->ext_itf.rd_id));
  s = format (s, "flags %x ", ntohl (a->ext_itf.flags));

  s = format (s, "\n");

  PRINT_S;

  return handle;
}

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

#endif /* __GBP_API_PRINT_H__ */