Skip to content

Commit

Permalink
finally compiles
Browse files Browse the repository at this point in the history
  • Loading branch information
maalvikabhat authored Feb 28, 2020
1 parent 90477ed commit a567510
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions exercises/ex04/trout/util.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <time.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <netinet/udp.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <sys/un.h>
#include <stdarg.h>
#include <syslog.h>
#include <unistd.h>

#define MAXLINE 4096

/* the following are a few definitions from Stevens' unp.h */
typedef void Sigfunc(int); /* for signal handlers */

void err_sys (char *fmt, ...);
void err_quit (char *fmt, ...);
char *Sock_ntop_host(const struct sockaddr *sa, socklen_t salen);
int sock_cmp_addr(const struct sockaddr *sa1,
const struct sockaddr *sa2, socklen_t salen);
void sock_set_port(struct sockaddr *sa, socklen_t salen, int port);
void tv_sub (struct timeval *out, struct timeval *in);
char *icmpcode_v4(int code);
Sigfunc *Signal(int signo, Sigfunc *func);
void *Calloc(size_t n, size_t size);
void Gettimeofday(struct timeval *tv, void *foo);
void Pipe(int *fds);
void Bind(int fd, const struct sockaddr *sa, socklen_t salen);
void Setsockopt(int fd, int level, int optname, const void *optval,
socklen_t optlen);
struct addrinfo *Host_serv(const char *host, const char *serv,
int family, int socktype);
ssize_t Read(int fd, void *ptr, size_t nbytes);
void Write(int fd, void *ptr, size_t nbytes);
ssize_t Recvfrom(int fd, void *ptr, size_t nbytes, int flags,
struct sockaddr *sa, socklen_t *salenptr);

0 comments on commit a567510

Please sign in to comment.