constants.asm (1661B)
1 %define BUFFER_SIZE 8192 ; 8KB recv buffer 2 %define URL_LENGTH_LIMIT 2000 3 %define DIRECTORY_LENGTH_LIMIT 100 4 5 %define MMAP_PROT_READ 0x1 6 %define MMAP_PROT_WRITE 0x2 7 %define MMAP_MAP_PRIVATE 0x2 8 %define MMAP_MAP_ANON 0x20 9 10 %define FD_STDOUT 0x1 11 12 %define OPEN_RDONLY 00 13 %define OPEN_DIRECTORY 0x10000 ; Open will fail if path is not a directory 14 15 %define LSEEK_SET 0 ; seek to offset bytes 16 %define LSEEK_END 2 ; seek to end plus offset 17 18 %define AF_INET 2 19 %define SOCK_STREAM 1 20 %define PROTO_TCP 6 21 22 %define LEVEL_SOL_TCP 1 23 %define LEVEL_IPPROTO_TCP 6 24 %define SOCKOPT_TCP_REUSEADDR 2 25 %define SOCKOPT_TCP_CORK 3 26 27 ;System Call Values 28 %define SYS_WRITE 1 ;int fd, const void *buf, size_t count 29 %define SYS_OPEN 2 ;const char *pathname, int flags, mode_t mode 30 %define SYS_CLOSE 3 ;unsigned int fd 31 %define SYS_LSEEK 8 ;int fd, off_t offset, int whence 32 %define SYS_MMAP 9 ;void *addr, size_t length, int prot, int flags, int fd, off_t offset 33 %define SYS_SENDFILE 40 ;int out_fd, int in_fd, off_t *offset, size_t count 34 %define SYS_SOCKET 41 ;int domain, int type, int protocol 35 %define SYS_ACCEPT 43 ;int sockfd, struct sockaddr *addr, socklen_t *addrlen 36 %define SYS_SENDTO 44 ;int sockfd, const void *buf, size_t len, int flags, ... 37 %define SYS_RECVFROM 45 ;int sockfd, void *buf, size_t len, int flags 38 %define SYS_BIND 49 ;int sockfd, const struct sockaddr *addr, socklen_t addrlen 39 %define SYS_LISTEN 50 ;int sockfd, int backlog 40 %define SYS_SETSOCKOPT 54; int sockfd, int level, int optname,const void *optval, socklen_t optlen 41 %define SYS_EXIT_GROUP 231 ;int status