Skip to content

Extra Credit - Networking #38

Description

@srujun

This issue will keep track of things that will need to be done to implement Networking within MazeOS.

System Calls - from Beej's Networking Guide

1. getaddrinfo() (and freeaddrinfo())

Populates a linked list of connection information.

int
getaddrinfo(const char *node,    // e.g. "www.example.com" or IP
            const char *service, // e.g. "http" or port number
            const struct addrinfo *hints,
            struct addrinfo **res);

2. socket()

Creates the file descriptor to use when sending or receiving data.

int
socket(int domain, int type, int protocol);

3. connect()

Connects the socket to the remote host.

int
bind(int sockfd, struct sockaddr *my_addr, int addrlen);

4. send() and recv() - for TCP sockets

Sending and receiving data for stream sockets.

int
send(int sockfd, const void *msg, int len, int flags);

int
recv(int sockfd, void *buf, int len, int flags);

4. sendto() and recvfrom() - for UDP sockets

Sending and receiving data for datagram sockets.

int
sendto(int sockfd, const void *msg, int len, unsigned int flags, const struct sockaddr *to, socklen_t tolen);

int
recvfrom(int sockfd, void *buf, int len, unsigned int flags, struct sockaddr *from, int *fromlen);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions