<commit_before>/** Copyright (C) 2018 European Spallation Source */
//===----------------------------------------------------------------------===//
///
/// \file
/// Class used to perform OS and Hardware related checks prior to
/// application start
///
//===----------------------------------------------------------------------===//

#pragma once

#include <string>
#include <vector>
#include <net/if.h>

class HwCheck {
public:
  /// status can be checked with ifconfig, here we request
  /// that the interface is both up and running meaning that
  /// there is link activity and an ip address has been assigned
  static const int myflags = IFF_UP | IFF_RUNNING;

  /// Currently the constructor does nothing
  HwCheck() {};

  /// Select interfaces to check
  bool checkMTU(std::vector<std::string> ignore);

  /// setter for MTU size check, mostly used for reverting
  /// to a lower MTU size, when running on ad hoc servers
  void setMinimumMTU(int mtu) { minimumMtu = mtu; }

  /// Gleaned from MacOS and CentOS and deemed ignore worthy
  std::vector<std::string> defaultIgnoredInterfaces = {"ppp0", "docker", "ov-", "wlp4s0"};

private:
  /// Check a single interface
  bool checkMTU(const char * interface);

  ///<commit_msg>"removed wifi adapter exception; updates #143"<commit_after>/** Copyright (C) 2018 European Spallation Source */
//===----------------------------------------------------------------------===//
///
/// \file
/// Class used to perform OS and Hardware related checks prior to
/// application start
///
//===----------------------------------------------------------------------===//

#pragma once

#include <string>
#include <vector>
#include <net/if.h>

class HwCheck {
public:
  /// status can be checked with ifconfig, here we request
  /// that the interface is both up and running meaning that
  /// there is link activity and an ip address has been assigned
  static const int myflags = IFF_UP | IFF_RUNNING;

  /// Currently the constructor does nothing
  HwCheck() {};

  /// Select interfaces to check
  bool checkMTU(std::vector<std::string> ignore);

  /// setter for MTU size check, mostly used for reverting
  /// to a lower MTU size, when running on ad hoc servers
  void setMinimumMTU(int mtu) { minimumMtu = mtu; }

  /// Gleaned from MacOS and CentOS and deemed ignore worthy
  std::vector<std::string> defaultIgnoredInterfaces = {"ppp0", "docker", "ov-"};

private:
  /// Check a single interface
  bool checkMTU(const char * interface);

  ///
{'fraction_non_alphanumeric': 0.22707248698438126, 'fraction_numerical': 0.006007208650380457, 'mean_word_length': 2.1342534504391466, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7214976', 'n_tokens_mistral': 683, 'n_tokens_neox': 652, 'n_words': 264}