<commit_before>#ifndef _HYPER_H_
#define _HYPER_H_

#include <stdint.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#include "net.h"
#include "list.h"
#include "exec.h"
#include "event.h"
#include "container.h"
#include "portmapping.h"

enum {
	RESERVED,
	STARTPOD,
	GETPOD,
	STOPPOD,
	DESTROYPOD,
	RESTARTCONTAINER,
	EXECCMD,
	CMDFINISHED,
	READY,
	ACK,
	ERROR,
	WINSIZE,
	PING,
	PODFINISHED,
	NEXT,
	WRITEFILE,
	READFILE,
	NEWCONTAINER,
	KILLCONTAINER,
	ONLINECPUMEM,
	SETUPINTERFACE,
	SETUPROUTE,
};

enum {
	POLICY_NEVER,
	POLICY_ALWAYS,
	POLICY_ONFAILURE,
};

struct hyper_pod {
	struct hyper_container	*c;
	struct hyper_interface	*iface;
	struct hyper_route	*rt;
	struct portmapping_white_list	*portmap_white_lists;
	char			**dns;
	struct list_head	containers;
	struct list_head	exec_head;
	char			*hostname;
	char			*share_tag;
	int			init_pid;
	uint32_t		i_num;
	uint32_t		r_num;
	uint32_t		e_num;
	uint32_t		d_num;
	uint32_t		type;
	/* how many containers are running */
	uint32_t		remains;
	uint8_t			policy;
	int			efd;
};

struct portmapping_white_list {
	char **internal_networks;
	char **external_networks;
	uint32_t i_num;
	uint32_t e_num;
};

struct hyper_win_size {
	char		*tty;
	int		row;
	int		column;
	uint64_t	seq;
};

struct hyper_killer {
	char		*id;
	int		signal;
};

struct hyper_reader {
	char		*id;
	char		*file;
};

struct hyper_writter {
	char		*id;
	char		*file;
	uint8_t		*data;
	int		len;
};

struct hyper_ctl {
	int			efd;
	struct hyper_event	tty;
	struct hyper_event	chan;
};

static inline int hyper_symlink(char *oldpath, char *newpath)
{
	return symlink(oldpath, newpath);
}

static inline int hyper_unlink(char *hyper_path)
{
	return unlink(hyper_path);
}

static inline int hyper_create(char *hyper_path)
{
	int fd = creat(hyper_path, 0755);
	if (fd < 0)
		return -1;

	close(fd);
	return 0;
}

int hyper_mkdir(char *hyper_path);
int hyper_open_serial(char *tty);
struct hyper_container *hyper_find_container(struct hyper_pod *pod, char *id);
int hyper_start_containers(struct hyper_pod *pod);
void hyper_cleanup_pod(struct hyper_pod *pod);

extern struct hyper_pod global_pod;
extern struct hyper_ctl ctl;
extern struct hyper_exec *global_exec;
#endif
<commit_msg>remove useless field in hyper_pod<commit_after>#ifndef _HYPER_H_
#define _HYPER_H_

#include <stdint.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#include "net.h"
#include "list.h"
#include "exec.h"
#include "event.h"
#include "container.h"
#include "portmapping.h"

enum {
	RESERVED,
	STARTPOD,
	GETPOD,
	STOPPOD,
	DESTROYPOD,
	RESTARTCONTAINER,
	EXECCMD,
	CMDFINISHED,
	READY,
	ACK,
	ERROR,
	WINSIZE,
	PING,
	PODFINISHED,
	NEXT,
	WRITEFILE,
	READFILE,
	NEWCONTAINER,
	KILLCONTAINER,
	ONLINECPUMEM,
	SETUPINTERFACE,
	SETUPROUTE,
};

enum {
	POLICY_NEVER,
	POLICY_ALWAYS,
	POLICY_ONFAILURE,
};

struct hyper_pod {
	struct hyper_interface	*iface;
	struct hyper_route	*rt;
	struct portmapping_white_list	*portmap_white_lists;
	char			**dns;
	struct list_head	containers;
	struct list_head	exec_head;
	char			*hostname;
	char			*share_tag;
	int			init_pid;
	uint32_t		i_num;
	uint32_t		r_num;
	uint32_t		d_num;
	uint32_t		type;
	/* how many containers are running */
	uint32_t		remains;
	uint8_t			policy;
	int			efd;
};

struct portmapping_white_list {
	char **internal_networks;
	char **external_networks;
	uint32_t i_num;
	uint32_t e_num;
};

struct hyper_win_size {
	char		*tty;
	int		row;
	int		column;
	uint64_t	seq;
};

struct hyper_killer {
	char		*id;
	int		signal;
};

struct hyper_reader {
	char		*id;
	char		*file;
};

struct hyper_writter {
	char		*id;
	char		*file;
	uint8_t		*data;
	int		len;
};

struct hyper_ctl {
	int			efd;
	struct hyper_event	tty;
	struct hyper_event	chan;
};

static inline int hyper_symlink(char *oldpath, char *newpath)
{
	return symlink(oldpath, newpath);
}

static inline int hyper_unlink(char *hyper_path)
{
	return unlink(hyper_path);
}

static inline int hyper_create(char *hyper_path)
{
	int fd = creat(hyper_path, 0755);
	if (fd < 0)
		return -1;

	close(fd);
	return 0;
}

int hyper_mkdir(char *hyper_path);
int hyper_open_serial(char *tty);
struct hyper_container *hyper_find_container(struct hyper_pod *pod, char *id);
int hyper_start_containers(struct hyper_pod *pod);
void hyper_cleanup_pod(struct hyper_pod *pod);

extern struct hyper_pod global_pod;
extern struct hyper_ctl ctl;
extern struct hyper_exec *global_exec;
#endif

{'fraction_non_alphanumeric': 0.10192652329749104, 'fraction_numerical': 0.011648745519713262, 'mean_word_length': 4.8213820078226854, 'pattern_counts': {'":': 0, '<': 15, '<?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': '5950111', 'n_tokens_mistral': 1982, 'n_tokens_neox': 1930, 'n_words': 443}