-
Notifications
You must be signed in to change notification settings - Fork 27
/
statusq.h
executable file
·106 lines (91 loc) · 2.49 KB
/
statusq.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#if !defined STATUSQ_H
#define STATUSQ_H
#if defined HAVE_STDINT_H
#include <stdint.h>
#endif
#include <sys/types.h>
#define FL_REQUEST 0x8000
#define FL_QUERY 0x7800
#define FL_NON_AUTH_ANSWER 0x0400
#define FL_DGRAM_NOT_TRUNCATED 0x0200
#define FL_RECURSION_NOT_DESIRED 0x0100
#define FL_RECURSION_NOT_AVAIl 0x0080
#define FL_RESERVED1 0x0040
#define FL_RESERVED2 0x0020
#define FL_BROADCAST 0x0010
#define FL_SUCCESS 0x000F
#define QT_NODE_STATUS_REQUEST 0x0021
#define QC_INTERNET 0x0001
#define NB_DGRAM 137
struct nbname {
char ascii_name [16] ;
my_uint16_t rr_flags;
};
struct nbname_request {
my_uint16_t transaction_id;
my_uint16_t flags;
my_uint16_t question_count;
my_uint16_t answer_count;
my_uint16_t name_service_count;
my_uint16_t additional_record_count;
char question_name[34];
my_uint16_t question_type;
my_uint16_t question_class;
};
#define NBNAME_REQUEST_SIZE 50
#define UDP_HEADER_SIZE 8
#define IP_HEADER_SIZE 20
typedef struct nbname_response_header {
my_uint16_t transaction_id;
my_uint16_t flags;
my_uint16_t question_count;
my_uint16_t answer_count;
my_uint16_t name_service_count;
my_uint16_t additional_record_count;
char question_name[34];
my_uint16_t question_type;
my_uint16_t question_class;
my_uint32_t ttl;
my_uint16_t rdata_length;
my_uint8_t number_of_names;
} nbname_response_header_t;
/* #define NBNAME_RESPONSE_NUMBER_OF_NAMES_OFFSET 56 */
#define NBNAME_RESPONSE_HEADER_SIZE 57
typedef struct nbname_response_footer {
my_uint8_t adapter_address [6];
my_uint8_t version_major;
my_uint8_t version_minor;
my_uint16_t duration;
my_uint16_t frmps_received;
my_uint16_t frmps_transmitted;
my_uint16_t iframe_receive_errors;
my_uint16_t transmit_aborts;
my_uint32_t transmitted;
my_uint32_t received;
my_uint16_t iframe_transmit_errors;
my_uint16_t no_receive_buffer;
my_uint16_t tl_timeouts;
my_uint16_t ti_timeouts;
my_uint16_t free_ncbs;
my_uint16_t ncbs;
my_uint16_t max_ncbs;
my_uint16_t no_transmit_buffers;
my_uint16_t max_datagram;
my_uint16_t pending_sessions;
my_uint16_t max_sessions;
my_uint16_t packet_sessions;
} nbname_response_footer_t ;
#define NBNAME_RESPONSE_FOOTER_SIZE 50
struct nb_host_info {
struct nbname_response_header* header;
struct nbname* names;
struct nbname_response_footer* footer;
int is_broken;
};
typedef struct nb_service {
char nb_name[16];
my_uint8_t service_number;
int unique;
char* service_name;
} nb_service_t ;
#endif /* STATUSQ_H */