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