<commit_before>/*
 * ethernet.cpp
 *
 *  Created on: Jan 11, 2020
 *      Author: devel
 */

#include "ethernet.hpp"

#include <bits/stdint-uintn.h>
#include <array>
#include <vector>

#include "../../../include/licensecc/datatypes.h"
#include "../../../projects/DEFAULT/include/licensecc/DEFAULT/licensecc_properties.h"
#include "../base/base.h"
#include "../os/network.hpp"
#include "pc_identifier.hpp"

namespace license {
namespace pc_identifier {
using namespace std;

static FUNCTION_RETURN generate_ethernet_pc_id(vector<array<uint8_t, PC_IDENTIFIER_PROPRIETARY_DATA>> &data,
											   const bool use_ip) {
	vector<os::OsAdapterInfo> adapters;

	FUNCTION_RETURN result_adapterInfos = getAdapterInfos(adapters);
	if (result_adapterInfos != FUNC_RET_OK) {
		return result_adapterInfos;
	}
	if (adapters.size() == 0) {
		return FUNC_RET_NOT_AVAIL;
	}

	for (auto &it : adapters) {
		unsigned int k, data_len, data_byte;
		array<uint8_t, PC_IDENTIFIER_PROPRIETARY_DATA> identifier;
		data_len = use_ip ? sizeof(os::OsAdapterInfo::ipv4_address) : sizeof(os::OsAdapterInfo::mac_address);

		for (k = 0; k < PC_IDENTIFIER_PROPRIETARY_DATA; k++) {
			if (k < data_len) {
				identifier[k] = use_ip ? it.ipv4_address[k] : it.mac_address[k];<commit_msg>fix include<commit_after>/*
 * ethernet.cpp
 *
 *  Created on: Jan 11, 2020
 *      Author: devel
 */


#include <array>
#include <vector>

#include "../../../include/licensecc/datatypes.h"
#include "../../../projects/DEFAULT/include/licensecc/DEFAULT/licensecc_properties.h"
#include "../base/base.h"
#include "../os/network.hpp"
#include "pc_identifier.hpp"
#include "ethernet.hpp"

namespace license {
namespace pc_identifier {
using namespace std;

static FUNCTION_RETURN generate_ethernet_pc_id(vector<array<uint8_t, PC_IDENTIFIER_PROPRIETARY_DATA>> &data,
											   const bool use_ip) {
	vector<os::OsAdapterInfo> adapters;

	FUNCTION_RETURN result_adapterInfos = getAdapterInfos(adapters);
	if (result_adapterInfos != FUNC_RET_OK) {
		return result_adapterInfos;
	}
	if (adapters.size() == 0) {
		return FUNC_RET_NOT_AVAIL;
	}

	for (auto &it : adapters) {
		unsigned int k, data_len, data_byte;
		array<uint8_t, PC_IDENTIFIER_PROPRIETARY_DATA> identifier;
		data_len = use_ip ? sizeof(os::OsAdapterInfo::ipv4_address) : sizeof(os::OsAdapterInfo::mac_address);

		for (k = 0; k < PC_IDENTIFIER_PROPRIETARY_DATA; k++) {
			if (k < data_len) {
				identifier[k] = use_ip ? it.ipv4_address[k] : it.mac_address[k];
{'fraction_non_alphanumeric': 0.1397979797979798, 'fraction_numerical': 0.009696969696969697, 'mean_word_length': 4.665903890160183, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 16, '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': '4808976', 'n_tokens_mistral': 968, 'n_tokens_neox': 902, 'n_words': 170}