First attempt at http
This commit is contained in:
parent
440694e3d3
commit
80e722366d
6 changed files with 391 additions and 6 deletions
|
@ -62,7 +62,9 @@ typedef enum
|
|||
GRUB_ERR_NET_NO_ANSWER,
|
||||
GRUB_ERR_WAIT,
|
||||
GRUB_ERR_BUG,
|
||||
GRUB_ERR_NET_PORT_CLOSED
|
||||
GRUB_ERR_NET_PORT_CLOSED,
|
||||
GRUB_ERR_NET_INVALID_RESPONSE,
|
||||
GRUB_ERR_NET_UNKNOWN_ERROR
|
||||
}
|
||||
grub_err_t;
|
||||
|
||||
|
|
|
@ -302,6 +302,20 @@ void EXPORT_FUNC (__deregister_frame_info) (void);
|
|||
|
||||
/* Inline functions. */
|
||||
|
||||
static inline char *
|
||||
grub_memchr (const void *p, int c, grub_size_t len)
|
||||
{
|
||||
const char *s = p;
|
||||
const char *e = s + len;
|
||||
|
||||
for (; s < e; s++)
|
||||
if (*s == c)
|
||||
return (char *) s;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static inline unsigned int
|
||||
grub_abs (int x)
|
||||
{
|
||||
|
|
|
@ -27,9 +27,16 @@
|
|||
#include <grub/mm.h>
|
||||
#include <grub/net/netbuff.h>
|
||||
|
||||
#define GRUB_NET_MAX_LINK_HEADER_SIZE 64
|
||||
#define GRUB_NET_UDP_HEADER_SIZE 8
|
||||
#define GRUB_NET_OUR_IPV4_HEADER_SIZE 20
|
||||
enum
|
||||
{
|
||||
GRUB_NET_MAX_LINK_HEADER_SIZE = 64,
|
||||
GRUB_NET_UDP_HEADER_SIZE = 8,
|
||||
GRUB_NET_TCP_HEADER_SIZE = 20,
|
||||
GRUB_NET_OUR_IPV4_HEADER_SIZE = 20,
|
||||
GRUB_NET_TCP_RESERVE_SIZE = GRUB_NET_TCP_HEADER_SIZE
|
||||
+ GRUB_NET_OUR_IPV4_HEADER_SIZE
|
||||
+ GRUB_NET_MAX_LINK_HEADER_SIZE
|
||||
};
|
||||
|
||||
typedef enum grub_link_level_protocol_id
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue