• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OPAE / opae-sdk / 1589531254

pending completion
1589531254

Pull #2407

github

GitHub
Merge fe20a62fa into 1e53e203c
Pull Request #2407: hssi: add UIO Dest MAC Address setter

94 of 94 new or added lines in 5 files covered. (100.0%)

11100 of 18185 relevant lines covered (61.04%)

12921.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/samples/hssi/hssi_pkt_filt_10g_cmd.h
1
// Copyright(c) 2021, Intel Corporation
2
//
3
// Redistribution  and  use  in source  and  binary  forms,  with  or  without
4
// modification, are permitted provided that the following conditions are met:
5
//
6
// * Redistributions of  source code  must retain the  above copyright notice,
7
//   this list of conditions and the following disclaimer.
8
// * Redistributions in binary form must reproduce the above copyright notice,
9
//   this list of conditions and the following disclaimer in the documentation
10
//   and/or other materials provided with the distribution.
11
// * Neither the name  of Intel Corporation  nor the names of its contributors
12
//   may be used to  endorse or promote  products derived  from this  software
13
//   without specific prior written permission.
14
//
15
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,  BUT NOT LIMITED TO,  THE
17
// IMPLIED WARRANTIES OF  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18
// ARE DISCLAIMED.  IN NO EVENT  SHALL THE COPYRIGHT OWNER  OR CONTRIBUTORS BE
19
// LIABLE  FOR  ANY  DIRECT,  INDIRECT,  INCIDENTAL,  SPECIAL,  EXEMPLARY,  OR
20
// CONSEQUENTIAL  DAMAGES  (INCLUDING,  BUT  NOT LIMITED  TO,  PROCUREMENT  OF
21
// SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE,  DATA, OR PROFITS;  OR BUSINESS
22
// INTERRUPTION)  HOWEVER CAUSED  AND ON ANY THEORY  OF LIABILITY,  WHETHER IN
23
// CONTRACT,  STRICT LIABILITY,  OR TORT  (INCLUDING NEGLIGENCE  OR OTHERWISE)
24
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,  EVEN IF ADVISED OF THE
25
// POSSIBILITY OF SUCH DAMAGE.
26
#pragma once
27
#include <iostream>
28
#include <string>
29
#include "hssi_10g_cmd.h"
30

31
class hssi_pkt_filt_10g_cmd : public hssi_10g_cmd
32
{
33
public:
34
  hssi_pkt_filt_10g_cmd()
×
35
    : dfl_dev_("none")
×
36
  {}
×
37

38
  virtual const char *name() const override
×
39
  {
40
    return "pkt_filt_10g";
×
41
  }
42

43
  virtual const char *description() const override
×
44
  {
45
    return "10G Packet Filter test\n";
×
46
  }
47

48
  virtual void add_options(CLI::App *app) override
×
49
  {
50
    auto opt = app->add_option("--dfl-dev", dfl_dev_,
×
51
                               "dfl device");
52
    opt->default_str(dfl_dev_);
×
53

54
    hssi_10g_cmd::add_options(app);
×
55
  }
×
56

57
  virtual int run(test_afu *afu, CLI::App *app) override
×
58
  {
59
    uint64_t bin_dest_addr = mac_bits_for(dest_addr_);
×
60
    if (bin_dest_addr == INVALID_MAC) {
×
61
      std::cerr << "invalid MAC address: " << dest_addr_ << std::endl;
×
62
      return test_afu::error;
×
63
    }
64

65
    std::string dfl_dev = dfl_dev_;
×
66
    if (dfl_dev == "none") {
×
67
      std::cout << "--dfl-dev is missing." << std::endl
×
68
                << "Skipping Packet Filter." << std::endl
×
69
                << std::endl;
×
70
    } else {
71
      std::cout << "Packet Filter" << std::endl
×
72
                << "  dfl_dev: " << dfl_dev << std::endl
×
73
                << std::endl;
×
74

75
      int res = set_pkt_filt_dest(dfl_dev, bin_dest_addr);
×
76
      if (res != test_afu::success)
×
77
        return res;
×
78
    }
79

80
    return hssi_10g_cmd::run(afu, app);
×
81
  }
82

83
protected:
84
  std::string dfl_dev_;
85
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc