aboutsummaryrefslogtreecommitdiffstats
path: root/GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-2cnf.py
diff options
context:
space:
mode:
authorMaros Mullner <maros.mullner@pantheon.tech>2020-06-16 07:40:11 +0200
committerPeter Mikus <pmikus@cisco.com>2020-06-17 07:15:29 +0000
commitc59d6c3dba4317facb66b77530b222aefb4cd252 (patch)
tree8c4df65cb5092c8feeaf29daa734ee23d9e7fb94 /GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-2cnf.py
parenta6464e9cefe273bd3caea8b672895e208aeb0fcb (diff)
NAT44-EI traffic profiles fix.
Signed-off-by: Maros Mullner <maros.mullner@pantheon.tech> Change-Id: I200d566aa94c2ae183aa3bc9db85a290f9da858d
Diffstat (limited to 'GPL/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-2cnf.py')
0 files changed, 0 insertions, 0 deletions
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.
 */
/*
  Copyright (c) 2004 Eliot Dresselhaus

  Permission is hereby granted, free of charge, to any person obtaining
  a copy of this software and associated documentation files (the
  "Software"), to deal in the Software without restriction, including
  without limitation the rights to use, copy, modify, merge, publish,
  distribute, sublicense, and/or sell copies of the Software, and to
  permit persons to whom the Software is furnished to do so, subject to
  the following conditions:

  The above copyright notice and this permission notice shall be
  included in all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#include <vppinfra/vec.h>
#include <vppinfra/format.h>
#include <vppinfra/error.h>
#include <vppinfra/md5.h>

#include <fcntl.h>
#include <unistd.h>

static clib_error_t *md5_test_suite (void);

int
main (int argc, char *argv[])
{
  int i;

  if (argc == 1)
    {
      clib_error_t *e;
      e = md5_test_suite ();
      if (e)
	{
	  clib_error_report (e);
	  exit (1);
	}
    }

  for (i = 1; i < argc; i++)
    {
      md5_context_t m;
      u8 digest[16];
      u8 buffer[64 * 1024];
      int fd, n;

      fd = open (argv[i], 0);
      if (fd < 0)
	clib_unix_error ("can't open %s", argv[i]);

      md5_init (&m);
      while ((n = read (fd, buffer, sizeof (buffer))) > 0)
	md5_add (&m, buffer, n);
      close (fd);
      md5_finish (&m, digest);
      fformat (stdout, "%U  %s\n",
	       format_hex_bytes, digest, sizeof (digest), argv[i]);
    }

  return 0;
}

static clib_error_t *
md5_test_suite (void)
{
  typedef struct
  {
    char *input;
    char *output;
  } md5_test_t;

  static md5_test_t tests[] = {
    {.input = "",
     .output = "d41d8cd98f00b204e9800998ecf8427e",},
    {.input = "a",
     .output = "0cc175b9c0f1b6a831c399e269772661",},
    {.input = "abc",
     .output = "900150983cd24fb0d6963f7d28e17f72",},
    {.input = "message digest",
     .output = "f96b697d7cb7938d525a2f31aaf161d0",},
    {.input = "abcdefghijklmnopqrstuvwxyz",
     .output = "c3fcd3d76192e4007dfb496cca67e13b",},
    {.input =
     "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
     .output = "d174ab98d277d9f5a5611c2c9f419d9f",},
    {.input =
     "12345678901234567890123456789012345678901234567890123456789012345678901234567890",
     .output = "57edf4a22be3c955ac49da2e2107b67a",},
  };

  int i;
  u8 *s;
  md5_context_t m;
  u8 digest[16];

  for (i = 0; i < ARRAY_LEN (tests); i++)
    {
      md5_init (&m);
      md5_add (&m, tests[i].input, strlen (tests[i].input));
      md5_finish (&m, digest);
      s = format (0, "%U", format_hex_bytes, digest, sizeof (digest));
      if (memcmp (s, tests[i].output, 2 * sizeof (digest)))
	return clib_error_return
	  (0, "%s -> %v expected %s", tests[i].input, s, tests[i].output);
      vec_free (s);
    }

  return 0;
}

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