tftp.c (59086) | tftp.c (59766) |
---|---|
1/* $NetBSD: tftp.c,v 1.4 1997/09/17 16:57:07 drochner Exp $ */ 2 3/* 4 * Copyright (c) 1996 5 * Matthias Drochner. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 16 unchanged lines hidden (view full) --- 25 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 * | 1/* $NetBSD: tftp.c,v 1.4 1997/09/17 16:57:07 drochner Exp $ */ 2 3/* 4 * Copyright (c) 1996 5 * Matthias Drochner. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 16 unchanged lines hidden (view full) --- 25 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 * |
33 * $FreeBSD: head/lib/libstand/tftp.c 59086 2000-04-08 01:18:04Z ps $ | 33 * $FreeBSD: head/lib/libstand/tftp.c 59766 2000-04-29 20:47:10Z jlemon $ |
34 */ 35 36/* 37 * Simple TFTP implementation for libsa. 38 * Assumes: 39 * - socket descriptor (int) at open_file->f_devdata 40 * - server host IP in global servip 41 * Restrictions: --- 20 unchanged lines hidden (view full) --- 62static int tftp_open(const char *path, struct open_file *f); 63static int tftp_close(struct open_file *f); 64static int tftp_read(struct open_file *f, void *buf, size_t size, size_t *resid); 65static int tftp_write(struct open_file *f, void *buf, size_t size, size_t *resid); 66static off_t tftp_seek(struct open_file *f, off_t offset, int where); 67static int tftp_stat(struct open_file *f, struct stat *sb); 68 69struct fs_ops tftp_fsops = { | 34 */ 35 36/* 37 * Simple TFTP implementation for libsa. 38 * Assumes: 39 * - socket descriptor (int) at open_file->f_devdata 40 * - server host IP in global servip 41 * Restrictions: --- 20 unchanged lines hidden (view full) --- 62static int tftp_open(const char *path, struct open_file *f); 63static int tftp_close(struct open_file *f); 64static int tftp_read(struct open_file *f, void *buf, size_t size, size_t *resid); 65static int tftp_write(struct open_file *f, void *buf, size_t size, size_t *resid); 66static off_t tftp_seek(struct open_file *f, off_t offset, int where); 67static int tftp_stat(struct open_file *f, struct stat *sb); 68 69struct fs_ops tftp_fsops = { |
70 "tftp", tftp_open, tftp_close, tftp_read, tftp_write, tftp_seek, tftp_stat | 70 "tftp", 71 tftp_open, 72 tftp_close, 73 tftp_read, 74 tftp_write, 75 tftp_seek, 76 tftp_stat, 77 null_readdir |
71}; 72 73extern struct in_addr servip; 74 75static int tftpport = 2000; 76 77#define RSPACE 520 /* max data packet, rounded up */ 78 --- 330 unchanged lines hidden --- | 78}; 79 80extern struct in_addr servip; 81 82static int tftpport = 2000; 83 84#define RSPACE 520 /* max data packet, rounded up */ 85 --- 330 unchanged lines hidden --- |