forked from gawen947/wsn-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mac-parse.h
65 lines (44 loc) · 2.2 KB
/
mac-parse.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
55
56
57
58
59
60
61
62
63
64
65
/* File: mac-parse.h
Copyright (C) 2013 David Hauweele <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _MAC_PARSE_H_
#define _MAC_PARSE_H_
#include "mac.h"
/* Parse the MAC frame type. */
void parse_type(struct mac_frame *frame, const char *type_arg);
/* Parse the reserved field. */
void parse_reserved(struct mac_frame *frame, const char *reserved_arg);
/* Parse the Source Address Mode. */
void parse_sam(struct mac_frame *frame, const char *sam_arg);
/* Parse the Destination Address Mode. */
void parse_dam(struct mac_frame *frame, const char *dam_arg);
/* Parse the version. */
void parse_version(struct mac_frame *frame, const char *version_arg);
/* Parse the source address. */
void parse_saddr(struct mac_frame *frame, const char *addr_arg);
/* Parse the destination address. */
void parse_daddr(struct mac_frame *frame, const char *addr_arg);
/* Parse the sequence number. */
void parse_seqno(struct mac_frame *frame, const char *seqno_arg);
/* Parse the MAC control flags. */
void parse_flags(struct mac_frame *frame, const char *flags);
/* Parse a flag to enable. */
void parse_flag_enable(struct mac_frame *frame, unsigned int flag);
/* Parse a flag to disable. */
void parse_flag_disable(struct mac_frame *frame, unsigned int flag);
/* Decode a frame from a file. */
void parse_frame_from_file(struct mac_frame *frame, const char *filename);
/* Setup the frame's payload from a file. */
void setup_payload_from_file(struct mac_frame *frame, const char *filename);
/* Setup a frame with the default values. */
void setup_default_frame(struct mac_frame *frame);
#endif /* _MAC_PARSE_H_ */