Material for CS 3210 (Unix) Final ================================= Format ------ Match: 25 @ 1 pt/ea = 25 FITB: 15 @ 2 pt/ea = 30 Mult: 10 @ 2 pt/ea = 20 Short: 5 @ 5 pt/ea = 25 Material -------- Ch 16: Networking / Sockets - packet - router - hop - traceroute - sequence numbers - TCP/IP stack - Connection-oriented stream (TCP) vs. Connectionless datagram (UDP) - netstat - nmap - IP address - Domain Name System (DNS) - daemon - port / port number - OSI 7-layer model - /etc/services - netcat (nc) - socket - Domain Sockets (single-host) vs. Internet Sockets (multi-host) - server - client - socket / bind / listen / accept - telnet - ping - ifconfig - host Ch 17: Time - date - funcs for getting time: time(), localtime(time(NULL)), gettimeofday() - sleep() / usleep() / nanosleep() / select() - One-Shot Timer: alarm() SIGALRM vs. Recurring Timers: setitimer() Ch 18: Random Numbers - pseudorandom - /dev/random / /dev/urandom - srand / rand - The right way to seed the random number generator: srand(time(NULL) + getpid()); Ch 19-20: Skip Ch 21: String Matching - String Matching, 2 ways: diff tween globbing & regexes - Globbing - Regular Expressions - regex wildcards: ., [], [^] - regex quantifiers: ?, *, + \{\} - regex anchors: ^, $, \<, \>, \b, \B - grep / egrep - regcomp / regerror / regexec / regfree - locate Ch 22: S-Lang - readline - S-Lang - character set - SLsmg_set_char_set - multi-byte escape keys (reading w/ SLang) Ch 23: Berkeley DB - Abstract Data Types (or "ADTs") - hashes - hash, B-Tree, RECNO - dbopen: constructor - db->close: destructor - db funcs: add / edit: db->put, iterating: db->seq, retrieving: db->get, removing: db->del - db->fd, db->sync Ch 24: Parsing Command-Line Options - options / flags / switches - getopt - option string "ab:c:d::" - getopt_long - setting "flag" variables - popt - autohelp: POPT_AUTOHELP - advantages of popt over getopt Ch 25: Dynamically Loading Libraries at Run-Time - Function Pointer - Function signature - lib opening flags: RTLD_LAZY, RTLD_NOW - dynlib funcs: dlopen, dlsym, dlclose, dlerror - strtod Ch 26: Names and the User Database - /etc/passwd - /etc/group - /etc/shadow - getty - login - gecos - crack - id - passwd - finger - chfn - groups - adduser - getpwnam(), getpwuid() - getgrnam(), getgruid() - setpwent(), getpwent(), endpwent() - /var/run/utmp - /var/log/wtmp - /var/log/btmp - who - w - last - setutent(), getutent(), endutent() - getutline(), pututline() Other stuff: - man - extern