<commit_before>
#ifndef __IGMP_H_
#define __IGMP_H_

#include "message.h"
#include "ip.h"
#include <slack/list.h>
#include <slack/err.h>

// SO far these are not needed, but they might be later.
//#include "protocols.h"
//#include "grouter.h"
//
//#include <slack/err.h>
//#include <netinet/in.h>
//#include <sys/time.h>
//#include <stdio.h>
//#include <string.h>
//#include <stdint.h>
//#include <endian.h>


/* Global variables, structs and constants */
#define IP_MAX_MEMBERSHIPS 		4
#define IGMP_V1_Router_timeout 	1 //TODO : what is threshold for TTL at each router ?

// Andrey comment: I don't know if the below info has any relevance to the IGMP protocol.
// Andrey comment: So, I will try to find some stuff online for those constants.

#define IGMP_HOST_MEMBERSHIP_QUERY   17
#define IGMP_HOST_MEMBERSHIP_REPORT  18

/* Codes for UNREACH. */
#define IGMP_NET_UNREACH        0       /* Network Unreachable          */
#define IGMP_HOST_UNREACH       1       /* Host Unreachable             */
#define IGMP_PROT_UNREACH       2       /* Protocol Unreachable         */
#define IGMP_PORT_UNREACH       3       /* Port Unreachable             */
#define IGMP_FRAG_NEEDED        4       /* Fragmentation Needed/DF set  */
#define IGMP_SR_FAILED          5       /* Source Route failed          */
#define IGMP_NET_UNKNOWN        6
#define IGMP_HOST_UNKNOWN       7

/* Codes for REDIRECT. */
#define IGMP_REDIR_NET          0       /* Redirect Net                 */
#define IGMP_REDIR_HOST         1       /* Redirect Host                */
#define IGMP_REDIR_NETTOS       2       /* Redirect Net for TOS         */
#define IGMP_REDIR_HOSTTOS      3       /* Redirect Host for TOS        */

/* Codes for TIME_EXCEEDED. */
#define IGMP_TTL_EXPIRED        11      /* Time Exceeded                */
#define IGMP_EXC_FRAGTIME       1       /* Fragment Reass time exceeded */

// IGMP structure definitions go here...
/*typedef struct _igmphdr_t
{
	uchar igmp_version;                   // version
	uchar igmp_type;                   // type
	uint8_t igmp_unused:8;
	ushort igmp_checksum:16;
} igmphdr_t;<commit_msg>change to igmp.h which i forgot to comit<commit_after>
#ifndef __IGMP_H_
#define __IGMP_H_

#include "message.h"
#include "ip.h"
#include <slack/list.h>
#include <slack/err.h>

// SO far these are not needed, but they might be later.
//#include "protocols.h"
//#include "grouter.h"
//
//#include <slack/err.h>
//#include <netinet/in.h>
//#include <sys/time.h>
//#include <stdio.h>
//#include <string.h>
//#include <stdint.h>
//#include <endian.h>


/* Global variables, structs and constants */
#define IP_MAX_MEMBERSHIPS 		4
#define IGMP_V1_Router_timeout 	1 //TODO : what is threshold for TTL at each router ?

// Andrey comment: I don't know if the below info has any relevance to the IGMP protocol.
// Andrey comment: So, I will try to find some stuff online for those constants.

#define IGMP_HOST_MEMBERSHIP_QUERY   17
#define IGMP_HOST_MEMBERSHIP_REPORT  18
#define IGMP_DVMRP_MESSAGE			19

#define IGMP_DVMRP_PROBE   1
#define IGMP_DVMRP_REPORT  2
#define IGMP_DVMRP_PRUNE   7
#define IGMP_DVMRP_GRAFT   8
#define IGMP_DVMRP_GRAFT_ACK   9

/* Codes for UNREACH. */
#define IGMP_NET_UNREACH        0       /* Network Unreachable          */
#define IGMP_HOST_UNREACH       1       /* Host Unreachable             */
#define IGMP_PROT_UNREACH       2       /* Protocol Unreachable         */
#define IGMP_PORT_UNREACH       3       /* Port Unreachable             */
#define IGMP_FRAG_NEEDED        4       /* Fragmentation Needed/DF set  */
#define IGMP_SR_FAILED          5       /* Source Route failed          */
#define IGMP_NET_UNKNOWN        6
#define IGMP_HOST_UNKNOWN       7

/* Codes for REDIRECT. */
#define IGMP_REDIR_NET          0       /* Redirect Net                 */
#define IGMP_REDIR_HOST         1       /* Redirect Host                */
#define IGMP_REDIR_NETTOS       2       /* Redirect Net for TOS         */
#define IGMP_REDIR_HOSTTOS      3       /* Redirect Host for TOS        */

/* Codes for TIME_EXCEEDED. */
#define IGMP_TTL_EXPIRED        11      /* Time Exceeded                */
#define IGMP_EXC_FRAGTIME       1       /* Fragment Reass time exceeded */

// IGMP structure definitions go here...
/*typedef struct _igmphdr_t
{
	uchar igmp_version;                   // version
	uchar igmp_type;                   // type
	uint8_t igmp_unused:8;
	ushort igmp_checksum:16;
} igmphdr_t;
{'fraction_non_alphanumeric': 0.09467056442545536, 'fraction_numerical': 0.013267371261524623, 'mean_word_length': 2.220854453294714, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '6777000', 'n_tokens_mistral': 1594, 'n_tokens_neox': 1508, 'n_words': 424}