⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iscsi_init.h

📁 iscsi-init LINUX boot
💻 H
字号:
/* * iSCSI boot initialization module for Linux * maintained by Igor Feoktistov <ifeoktistov@users.sourceforge.net> * * This program is free software; you can redistribute it and/or modify * it  under  the terms  of the GNU General Public License as published * by the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * */#define PROC_BLOCK_SIZE (PAGE_SIZE - 1024)/* Define the friendly delay before and after opening net devices */#define CONF_PRE_OPEN		(HZ/2)	/* Before opening: 1/2 second */#define CONF_POST_OPEN		(2*HZ)	/* After opening: 2 seconds *//* Define the timeout for waiting for a DHCP reply */#define CONF_OPEN_RETRIES 	2	/* (Re)open devices twice */#define CONF_SEND_RETRIES 	6	/* Send six requests per open */#define CONF_INTER_TIMEOUT	(HZ/2)	/* Inter-device timeout: 1/2 second */#define CONF_BASE_TIMEOUT	(HZ*2)	/* Initial timeout: 2 seconds */#define CONF_TIMEOUT_RANDOM	(HZ)	/* Maximum amount of randomization */#define CONF_TIMEOUT_MULT	*7/4	/* Rate of timeout growth */#define CONF_TIMEOUT_MAX	(HZ*30)	/* Maximum allowed timeout */#define CONF_NAMESERVERS_MAX	5       /* Maximum number of nameservers */struct iscsi_interface {    struct iscsi_interface *next;    struct net_device *dev;    u32 servaddr;    u32 if_addr;    u32 if_netmask;    u32 gateway;    int bootp_got_reply;    int bootp_msgtype;    char *if_name;    char host[__NEW_UTS_LEN];    char domain[64];    char nisdomain[__NEW_UTS_LEN];    u32 nameservers[CONF_NAMESERVERS_MAX];    char *root_path;};struct iscsi_device {    struct iscsi_device *next;    struct net_device *dev;    struct iscsi_interface *iscsi_if;    unsigned short flags;    u32 xid;};struct iscsi_target {    struct iscsi_target *next;    char *target_if;    char *target_ip;    char *target_name;};struct iscsi_param {    struct iscsi_param *next;    char *name;    char *value;};/* supported iscsi.conf parameters */#define ISCSI_CFG_USERNAME		"Username"#define ISCSI_CFG_INCOMINGUSERNAME	"IncomingUsername"#define ISCSI_CFG_PASSWORD		"Password"#define ISCSI_CFG_INCOMINGPASSWORD	"IncomingPassword"#define ISCSI_CFG_OUTGOINGUSERNAME	"OutgoingUsername"#define ISCSI_CFG_OUTGOINGPASSWORD	"OutgoingPassword"#define ISCSI_CFG_HEADERDIGEST		"HeaderDigest"#define ISCSI_CFG_DATADIGEST		"DataDigest"#define ISCSI_CFG_LOGINTIMEOUT		"LoginTimeout"#define ISCSI_CFG_AUTHTIMEOUT		"AuthTimeout"#define ISCSI_CFG_IDLETIMEOUT		"IdleTimeout"#define ISCSI_CFG_CONNFAILTIMEOUT	"ConnFailTimeout"#define ISCSI_CFG_PINGTIMEOUT		"PingTimeout"#define ISCSI_CFG_INITIALR2T		"InitialR2T"#define ISCSI_CFG_IMMEDIATEDATA		"ImmediateData"#define ISCSI_CFG_MAXRECVDATASEGLEN	"MaxRecvDataSegmentLength"#define ISCSI_CFG_FIRSTBURSTLENGTH	"FirstBurstLength"#define ISCSI_CFG_MAXFURSTLENGTH	"MaxBurstLength"#define ISCSI_CFG_TCPWINSIZE		"TCPWindowSize"/* Linux iSCSI module related stuff */#define TARGET_NAME_MAXLEN	255#define AUTH_STR_MAX_LEN	256#define ISCSI_MAX_TARGETS	256#define ISCSI_DEVICE "/dev/iscsictl"#define ISCSI_IOCTL_DEV "iscsictl"#define ISCSI_CONFIG_FILE "/etc/iscsi.conf"#define ISCSI_DEFAULT_PORT 3260#define DRIVER_ISID_0  0x00#define DRIVER_ISID_1  0x02#define DRIVER_ISID_2  0x3D#define ISCSI_DIGEST_NONE  0#define ISCSI_DIGEST_CRC32C 1#define ISCSI_DIGEST_CRC32C_NONE 2 /* offer both, prefer CRC32C */#define ISCSI_DIGEST_NONE_CRC32C 3 /* offer both, prefer None */#define ISCSI_SESSION_IOCTL_VERSION 25#define PORTAL_GROUP_TAG_UNKNOWN -1#define ISCSI_EST_SESS_CMD 0#define ISCSI_IOCTL 0xbc#define ISCSI_ESTABLISH_SESSION _IOW(ISCSI_IOCTL, ISCSI_EST_SESS_CMD, struct iscsi_session_ioctl)typedef uint8_t  UINT8;typedef uint16_t UINT16;typedef uint32_t UINT32;struct iscsi_portal_info {    int login_timeout;    int auth_timeout;    int active_timeout;    int idle_timeout;    int ping_timeout;    int abort_timeout;    int reset_timeout;    int replacement_timeout;    int initial_r2t;    int immediate_data;    int max_recv_data_segment_len;    int first_burst_len;    int max_burst_len;    int def_time2wait;    int def_time2retain;    int header_digest;    int data_digest;    int tag;    int tcp_window_size;    int type_of_service;    struct sockaddr addr;};struct iscsi_session_ioctl {    uint32_t ioctl_version;    uint32_t config_number;    int update;    uint8_t isid[6];    int password_length;    char username[AUTH_STR_MAX_LEN];    unsigned char password[AUTH_STR_MAX_LEN];    int password_length_in;    char username_in[AUTH_STR_MAX_LEN];    unsigned char password_in[AUTH_STR_MAX_LEN];    unsigned char target_name[TARGET_NAME_MAXLEN + 1];    unsigned char initiator_name[TARGET_NAME_MAXLEN + 1];    unsigned char initiator_alias[TARGET_NAME_MAXLEN + 1];    struct iscsi_portal_info portal;};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -