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

Minimal TCP client that bridges stdin/stdout to a socket. 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:

Macros

#define NC_BUF_SIZE   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)
int main (int argc, char *argv[])

Detailed Description

Minimal TCP client that bridges stdin/stdout to a socket.

Macro Definition Documentation

◆ NC_BUF_SIZE

#define NC_BUF_SIZE   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
Here is the caller graph for this function:

◆ parse_ipv4()

int parse_ipv4 ( const char * text,
in_addr_t * addr_out )
static
Here is the caller graph for this function:

◆ parse_port()

int parse_port ( const char * text)
static
Here is the caller graph for this function:

◆ print_usage()

void print_usage ( const char * prog)
static
Here is the caller graph for this function:

◆ write_all()

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