Home | History | Annotate | Download | only in kern

Lines Matching defs:tftp

35  * Download the root RAMdisk through TFTP at root mount time
68 * Copied from <lib/libsa/tftp.h>
175 * Strip leading "tftp:"
177 #define PREFIX "tftp:"
212 struct tftphdr *tftp;
216 size_t hdrlen = sizeof(*tftp) - sizeof(tftp->th_data);
241 * Set send buffer, prepare the TFTP packet
244 packetlen = sizeof(tftp->th_opcode) + namelen + sizeof(octetstr);
258 tftp = mtod(m_outbuf, struct tftphdr *);
259 memset(tftp, 0, packetlen);
261 tftp->th_opcode = htons((short)RRQ);
262 cp = tftp->th_stuff;
301 tftp->th_opcode = htons((short)ACK);
302 tftp->th_block = htons(trh->trh_block);
352 struct tftphdr *tftp;
355 size_t hdrlen = sizeof(*tftp) - sizeof(tftp->th_data);
367 * Check for packet too large for being a TFTP packet
377 * Examine the TFTP header
379 if (m->m_len > sizeof(*tftp)) {
380 if ((m = *mp = m_pullup(m, sizeof(*tftp))) == NULL) {
386 tftp = mtod(m, struct tftphdr *);
391 switch(ntohs(tftp->th_opcode)) {
400 if ((tftp->th_data[i] < ' ') ||
401 (tftp->th_data[i] > '~')) {
405 errbuf[i] = tftp->th_data[i];
409 printf("tftproot: TFTP server returned error %d, %s\n",
410 ntohs(tftp->th_code), errbuf);
417 DPRINTF(("%s():%d unexpected tftp reply opcode %d\n",
418 __func__, __LINE__, ntohs(tftp->th_opcode)));
433 if (ntohs(tftp->th_block) != trh->trh_block) {
435 __func__, __LINE__, trh->trh_block, ntohs(tftp->th_block)));