/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (C) 2008 Edwin Groothuis. All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8* 1. Redistributions of source code must retain the above copyright9* notice, this list of conditions and the following disclaimer.10* 2. Redistributions in binary form must reproduce the above copyright11* notice, this list of conditions and the following disclaimer in the12* documentation and/or other materials provided with the distribution.13*14* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND15* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE16* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE17* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE18* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL19* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS20* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)21* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT22* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY23* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF24* SUCH DAMAGE.25*/2627/*28* Options29*/3031void init_options(void);32uint16_t make_options(int peer, char *buffer, uint16_t size);33int parse_options(int peer, char *buffer, uint16_t size);3435/* Call back functions */36int option_tsize(int peer, struct tftphdr *, int, struct stat *);37int option_timeout(int peer);38int option_blksize(int peer);39int option_blksize2(int peer);40int option_rollover(int peer);41int option_windowsize(int peer);4243extern int options_extra_enabled;44extern int options_rfc_enabled;4546struct options {47const char *o_type;48char *o_request;49char *o_reply;50int (*o_handler)(int peer);51int rfc;52};5354extern struct options options[];55enum opt_enum {56OPT_TSIZE = 0,57OPT_TIMEOUT,58OPT_BLKSIZE,59OPT_BLKSIZE2,60OPT_ROLLOVER,61OPT_WINDOWSIZE,62};6364int options_set_request(enum opt_enum, const char *, ...)65__printf0like(2, 3);66int options_set_reply(enum opt_enum, const char *, ...)67__printf0like(2, 3);686970