summaryrefslogtreecommitdiffstats
path: root/src/pkg
AgeCommit message (Collapse)AuthorFilesLines
2019-07-12docs: how to enable coredump with systemdBenoît Ganne1-0/+5
Type: docs Change-Id: I1f657389fec716cc6cdc942803e65f861ffea5f5 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-03-15PAPI: Build python3 package for vpp_papiOle Troan2-5/+21
Change-Id: Iae53fe88a69b53b75a7439d159ae0f9d18545908 Signed-off-by: Ole Troan <ot@cisco.com>
2019-01-23cmake: fix debian preinst scriptDamjan Marion1-1/+1
Change-Id: I312beccb1bb6c02d6356bc9b8247178f11b8feb0 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-22cmake: supress 'Set runtime path of' noise while generatig deb packagesDamjan Marion1-1/+2
Change-Id: Ib8ddce2d56034152a390ca2d3b9784673a77d2e3 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-22cmake: fix debian package dependenciesDamjan Marion1-5/+4
Change-Id: Ib27c43a561dd000f8361ff732e76c6297a7ba900 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-22cmake: place include/ and share/ in /usr (debian packages)Damjan Marion1-4/+9
Change-Id: I980b76fb766d5734d4e822409a11ed09a06108a6 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-22cmake: don't set SONAME for pluginsDamjan Marion1-4/+0
Change-Id: I8cd782bb36a4c063afa312002192c254fd51bf5e Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-22cmake: package-deb target uses terminalDamjan Marion1-0/+1
Change-Id: I81b686cc1911c2ff52ead15c8199bdf9430fe59b Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-20Rework of debian packagingDamjan Marion9-0/+224
Change-Id: Ifede85d3af36f3ee6c6f8f92dcf5db0ed8f1bfeb Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Dave Barach <dave@barachs.net>
{ 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) 2015 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_flow_report_classify_h__
#define __included_flow_report_classify_h__

#define foreach_ipfix_ip4_field                                             \
_(ip->src_address.as_u32, ((u32[]){0xFFFFFFFF}), sourceIPv4Address, 4)      \
_(ip->dst_address.as_u32, ((u32[]){0xFFFFFFFF}), destinationIPv4Address, 4) \
_(ip->protocol, ((u8[]){0xFF}), protocolIdentifier, 1)

#define foreach_ipfix_ip6_field                                             \
_(ip6->src_address.as_u8,                                                   \
  ((u32[]){0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF}),                   \
  sourceIPv6Address, 16)                                                    \
_(ip6->dst_address.as_u8,                                                   \
  ((u32[]){0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF}),                   \
  destinationIPv6Address, 16)                                               \
_(ip6->protocol, ((u8[]){0xFF}), protocolIdentifier, 1)

#define foreach_ipfix_tcpudp_field                                          \
_(tcpudp->src_port, ((u16[]){0xFFFF}), sourceTransportPort, 2)              \
_(tcpudp->dst_port, ((u16[]){0xFFFF}), destinationTransportPort, 2)

#define foreach_ipfix_tcp_field                                             \
_(tcpudp->src_port, ((u16[]){0xFFFF}), tcpSourcePort, 2)                    \
_(tcpudp->dst_port, ((u16[]){0xFFFF}), tcpDestinationPort, 2)

#define foreach_ipfix_udp_field                                             \
_(tcpudp->src_port, ((u16[]){0xFFFF}), udpSourcePort, 2)                    \
_(tcpudp->dst_port, ((u16[]){0xFFFF}), udpDestinationPort, 2)

#define foreach_ipfix_transport_protocol_field                              \
  switch (transport_protocol) {                                             \
    case 255:                                                               \
      foreach_ipfix_tcpudp_field;                                           \
      break;                                                                \
    case 6:                                                                 \
      foreach_ipfix_tcp_field;                                              \
      break;                                                                \
    case 17:                                                                \
      foreach_ipfix_udp_field;                                              \
      break;                                                                \
  }

#define foreach_ipfix_field                                                 \
  if (ip_version == 4) {                                                    \
    ip = (ip4_header_t *)ip_start;                                          \
    tcpudp = (tcpudp_header_t *)(ip+1);                                     \
    foreach_ipfix_ip4_field;                                                \
  } else {                                                                  \
    ip6 = (ip6_header_t *)ip_start;                                         \
    tcpudp = (tcpudp_header_t *)(ip6+1);                                    \
    foreach_ipfix_ip6_field;                                                \
  }                                                                         \
  foreach_ipfix_transport_protocol_field

typedef struct
{
  u32 classify_table_index;
  u8 ip_version;
  u8 transport_protocol;
} ipfix_classify_table_t;

typedef struct
{
  u32 domain_id;
  u16 src_port;
  ipfix_classify_table_t *tables;
} flow_report_classify_main_t;

extern flow_report_classify_main_t flow_report_classify_main;

static_always_inline u8
ipfix_classify_table_index_valid (u32 index)
{
  flow_report_classify_main_t *fcm = &flow_report_classify_main;
  return index < vec_len (fcm->tables) &&
    fcm->tables[index].classify_table_index != ~0;
}

static_always_inline ipfix_classify_table_t *
ipfix_classify_add_table (void)
{
  flow_report_classify_main_t *fcm = &flow_report_classify_main;
  u32 i;
  for (i = 0; i < vec_len (fcm->tables); i++)
    if (!ipfix_classify_table_index_valid (i))
      return &fcm->tables[i];
  u32 index = vec_len (fcm->tables);
  vec_validate (fcm->tables, index);
  return &fcm->tables[index];
}

static_always_inline void
ipfix_classify_delete_table (u32 index)
{
  flow_report_classify_main_t *fcm = &flow_report_classify_main;
  ASSERT (index < vec_len (fcm->tables));
  ASSERT (fcm->tables[index].classify_table_index != ~0);
  fcm->tables[index].classify_table_index = ~0;
}

u8 *ipfix_classify_template_rewrite (flow_report_main_t * frm,
				     flow_report_t * fr,
				     ip4_address_t * collector_address,
				     ip4_address_t * src_address,
				     u16 collector_port);

vlib_frame_t *ipfix_classify_send_flows (flow_report_main_t * frm,
					 flow_report_t * fr,
					 vlib_frame_t * f,
					 u32 * to_next, u32 node_index);

#endif /* __included_flow_report_classify_h__ */

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