version 1.13, 2003/06/10 22:20:53 |
version 1.14, 2003/06/25 15:45:10 |
|
|
* Send the requested file. |
* Send the requested file. |
*/ |
*/ |
void |
void |
sendfile(fd, name, mode) |
sendfile(int fd, char *name, char *mode) |
int fd; |
|
char *name; |
|
char *mode; |
|
{ |
{ |
struct tftphdr *dp, *ap; /* data and ack packets */ |
struct tftphdr *dp, *ap; /* data and ack packets */ |
volatile int block, size, convert; |
volatile int block, size, convert; |
|
|
* Receive a file. |
* Receive a file. |
*/ |
*/ |
void |
void |
recvfile(fd, name, mode) |
recvfile(int fd, char *name, char *mode) |
int fd; |
|
char *name; |
|
char *mode; |
|
{ |
{ |
struct tftphdr *dp, *ap; |
struct tftphdr *dp, *ap; |
volatile int block, size, firsttrip; |
volatile int block, size, firsttrip; |
|
|
} |
} |
|
|
static int |
static int |
makerequest(request, name, tp, mode) |
makerequest(int request, const char *name, struct tftphdr *tp, |
int request; |
const char *mode) |
const char *name; |
|
struct tftphdr *tp; |
|
const char *mode; |
|
{ |
{ |
char *cp; |
char *cp; |
int len, pktlen; |
int len, pktlen; |
|
|
* offset by 100. |
* offset by 100. |
*/ |
*/ |
static void |
static void |
nak(error) |
nak(int error) |
int error; |
|
{ |
{ |
struct errmsg *pe; |
struct errmsg *pe; |
struct tftphdr *tp; |
struct tftphdr *tp; |
|
|
} |
} |
|
|
static void |
static void |
tpacket(s, tp, n) |
tpacket(const char *s, struct tftphdr *tp, int n) |
const char *s; |
|
struct tftphdr *tp; |
|
int n; |
|
{ |
{ |
static char *opcodes[] = |
static char *opcodes[] = |
{ "#0", "RRQ", "WRQ", "DATA", "ACK", "ERROR" }; |
{ "#0", "RRQ", "WRQ", "DATA", "ACK", "ERROR" }; |
|
|
} |
} |
|
|
static void |
static void |
printstats(direction, amount) |
printstats(const char *direction, unsigned long amount) |
const char *direction; |
|
unsigned long amount; |
|
{ |
{ |
double delta; |
double delta; |
/* compute delta in 1/10's second units */ |
/* compute delta in 1/10's second units */ |
|
|
} |
} |
|
|
static void |
static void |
timer(sig) |
timer(int sig) |
int sig; |
|
{ |
{ |
int save_errno = errno; |
int save_errno = errno; |
|
|