]> git.proxmox.com Git - grub2.git/blob - include/grub/net/netbuff.h
Add interface struct for communication between protocols and protocols stack.
[grub2.git] / include / grub / net / netbuff.h
1 #ifndef GRUB_NETBUFF_HEADER
2 #define GRUB_NETBUFF_HEADER
3
4 #include <grub/misc.h>
5
6 #define NETBUFF_ALIGN 2048
7 #define NETBUFFMINLEN 64
8
9 struct grub_net_buff
10 {
11 /*Pointer to the start of the buffer*/
12 char *head;
13 /*Pointer to the data */
14 char *data;
15 /*Pointer to the tail */
16 char *tail;
17 /*Pointer to the end of the buffer*/
18 char *end;
19 };
20
21 grub_err_t grub_netbuff_put (struct grub_net_buff *net_buff ,grub_size_t len);
22 grub_err_t grub_netbuff_unput (struct grub_net_buff *net_buff ,grub_size_t len);
23 grub_err_t grub_netbuff_push (struct grub_net_buff *net_buff ,grub_size_t len);
24 grub_err_t grub_netbuff_pull (struct grub_net_buff *net_buff ,grub_size_t len);
25 grub_err_t grub_netbuff_reserve (struct grub_net_buff *net_buff ,grub_size_t len);
26 grub_err_t grub_netbuff_clear (struct grub_net_buff *net_buff);
27 struct grub_net_buff * grub_netbuff_alloc ( grub_size_t len );
28 grub_err_t grub_netbuff_free (struct grub_net_buff *net_buff);
29 grub_err_t grub_netbuff_clear (struct grub_net_buff *net_buff);
30 #endif