<commit_before>/*
 * cdhcp_option.h
 *
 *  Created on: 11.09.2013
 *      Author: andreas
 */

#ifndef CDHCP_OPTION_H_
#define CDHCP_OPTION_H_

#ifdef __cplusplus
extern "C" {
#endif
#include <inttypes.h>
#ifdef __cplusplus
}
#endif

#include <exception>
#include <iostream>

#include <rofl/common/cmemory.h>

namespace dhcpv6snoop
{

class eDhcpOptionBase 		: public std::exception {};
class eDhcpOptionInval 		: public eDhcpOptionBase {};
class eDhcpOptionBadSyntax 	: public eDhcpOptionBase {};
class eDhcpOptionTooShort 	: public eDhcpOptionBase {};
class eDhcpOptionNotFound 	: public eDhcpOptionBase {};

class cdhcp_option :
		public rofl::cmemory
{
public:

	struct dhcp_option_hdr_t {
		uint16_t 	code;
		uint16_t 	len;
		uint8_t 	data[0];
	};<commit_msg>changed dhcp option header => endianness issue<commit_after>/*
 * cdhcp_option.h
 *
 *  Created on: 11.09.2013
 *      Author: andreas
 */

#ifndef CDHCP_OPTION_H_
#define CDHCP_OPTION_H_

#ifdef __cplusplus
extern "C" {
#endif
#include <inttypes.h>
#ifdef __cplusplus
}
#endif

#include <exception>
#include <iostream>

#include <rofl/common/cmemory.h>

namespace dhcpv6snoop
{

class eDhcpOptionBase 		: public std::exception {};
class eDhcpOptionInval 		: public eDhcpOptionBase {};
class eDhcpOptionBadSyntax 	: public eDhcpOptionBase {};
class eDhcpOptionTooShort 	: public eDhcpOptionBase {};
class eDhcpOptionNotFound 	: public eDhcpOptionBase {};

class cdhcp_option :
		public rofl::cmemory
{
public:

	struct dhcp_option_hdr_t {
		/* LITTLE ENDIAN */
		uint16_t 	len;
		uint16_t 	code;
		/* BIG ENDIAN */
#if 0
		uint16_t 	code;
		uint16_t 	len;
#endif
		uint8_t 	data[0];
	};
{'fraction_non_alphanumeric': 0.10303030303030303, 'fraction_numerical': 0.021212121212121213, 'mean_word_length': 4.540268456375839, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, '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': '4867812', 'n_tokens_mistral': 717, 'n_tokens_neox': 674, 'n_words': 140}