1/* hey emacs! -*- Mode: C; c-file-style: "k&r"; indent-tabs-mode: nil -*- */ 2/* 3 * options.h 4 * 5 * $Id: options.h,v 1.7 2001/07/06 23:35:18 jp Exp $ 6 * 7 * Copyright (c) 2000 Jean-Pierre Lefebvre <helix@step.polymtl.ca> 8 * and Remi Lefebvre <remi@debian.org> 9 * 10 * atftp is free software; you can redistribute them and/or modify them 11 * under the terms of the GNU General Public License as published by the 12 * Free Software Foundation; either version 2 of the License, or (at your 13 * option) any later version. 14 * 15 */ 16 17#ifndef options_h 18#define options_h 19 20#include "tftp_def.h" 21 22/* Structure definition for tftp options. */ 23struct tftp_opt { 24 char option[OPT_SIZE]; 25 char value[VAL_SIZE]; 26 int specified; /* specified by the client (for tftp server) */ 27 int enabled; /* enabled for use by server or client */ 28}; 29 30extern struct tftp_opt tftp_default_options[OPT_NUMBER]; 31 32int opt_parse_request(char *data, int data_size, struct tftp_opt *options); 33int opt_parse_options(char *data, int data_size, struct tftp_opt *options); 34int opt_set_options(struct tftp_opt *options, char *name, char *value); 35int opt_get_options(struct tftp_opt *options, char *name, char *value); 36int opt_disable_options(struct tftp_opt *options, char *name); 37int opt_support_options(struct tftp_opt *options); 38int opt_get_tsize(struct tftp_opt *options); 39int opt_get_timeout(struct tftp_opt *options); 40int opt_get_blksize(struct tftp_opt *options); 41int opt_get_multicast(struct tftp_opt *options, char *addr, int *port, int *mc); 42void opt_set_tsize(int tsize, struct tftp_opt *options); 43void opt_set_timeout(int timeout, struct tftp_opt *options); 44void opt_set_blksize(int blksize, struct tftp_opt *options); 45void opt_set_multicast(struct tftp_opt *options, char *addr, int port, int mc); 46void opt_request_to_string(struct tftp_opt *options, char *string, int len); 47void opt_options_to_string(struct tftp_opt *options, char *string, int len); 48 49#endif 50 51