forked from AllenDowney/ExercisesInC
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90477ed
commit a567510
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |