#ifndef GRUB_PROTOCOL_HEADER #define GRUB_PROTOCOL_HEADER #include #include #include #include struct protocol_operations; struct grub_net_protocol; struct grub_net_interface; struct grub_net_protocol { struct grub_net_protocol *next; char *name; grub_err_t (*open) (struct grub_net_interface* inf, struct grub_net_protocol *prot, struct grub_net_buff *nb); grub_err_t (*open_confirm) (struct grub_net_interface *inf, struct grub_net_protocol *prot, struct grub_net_buff *nb); grub_err_t (*get_payload) (struct grub_net_interface *inf, struct grub_net_protocol *prot, struct grub_net_buff *nb); grub_err_t (*get_payload_confirm) (struct grub_net_interface* inf, struct grub_net_protocol *prot, struct grub_net_buff *nb); grub_err_t (*close) (struct grub_net_interface *inf, struct grub_net_protocol *prot, struct grub_net_buff *nb); grub_err_t (*send) (struct grub_net_interface *inf , struct grub_net_protocol *prot, struct grub_net_buff *nb); grub_err_t (*recv) (struct grub_net_interface *inf , struct grub_net_protocol *prot, struct grub_net_buff *nb); }; typedef struct grub_net_protocol *grub_net_protocol_t; struct grub_net_interface { struct grub_net_card *card; struct grub_net_protocol* prot; char *path; char *username; char *password; /*transport layer addres*/ struct grub_net_addr *tla; /*internet layer addres*/ struct grub_net_addr *ila; /*link layer addres*/ struct grub_net_addr *lla; }; void grub_protocol_register (grub_net_protocol_t prot); void grub_protocol_unregister (grub_net_protocol_t prot); #endif