miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
Loading...
Searching...
No Matches
main.c File Reference

Minimal HTTP/1.0 GET client that prints only the response body. More...

#include <errno.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <unistd.h>
Include dependency graph for main.c:

Classes

struct  parsed_url_t

Macros

#define WGET_REQ_BUF   512
#define WGET_IO_BUF   512

Functions

static void print_usage (const char *prog)
static int write_all (int fd, const char *buf, size_t len)
static int parse_port (const char *text)
static unsigned short net_htons (unsigned short v)
static int parse_ipv4 (const char *text, in_addr_t *addr_out)
static int parse_url (const char *url, parsed_url_t *out)
int main (int argc, char *argv[])

Detailed Description

Minimal HTTP/1.0 GET client that prints only the response body.

Macro Definition Documentation

◆ WGET_IO_BUF

#define WGET_IO_BUF   512

◆ WGET_REQ_BUF

#define WGET_REQ_BUF   512

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )
Here is the call graph for this function:

◆ net_htons()

unsigned short net_htons ( unsigned short v)
static

◆ parse_ipv4()

int parse_ipv4 ( const char * text,
in_addr_t * addr_out )
static

◆ parse_port()

int parse_port ( const char * text)
static

◆ parse_url()

int parse_url ( const char * url,
parsed_url_t * out )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_usage()

void print_usage ( const char * prog)
static

◆ write_all()

int write_all ( int fd,
const char * buf,
size_t len )
static
Here is the call graph for this function: