-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxml.h
53 lines (35 loc) · 836 Bytes
/
xml.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
#ifndef __XML__
#define __XML__
#include"mxml.h"
#include<stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include<inttypes.h>
#include<assert.h>
#include<stdlib.h>
typedef struct {
uint16_t compression;
uint16_t type;
uint16_t class;
uint32_t ttl;
uint16_t length;
struct in_addr addr;
} __attribute__((packed)) dns_record_a_t;
typedef struct {
uint16_t compression;
uint16_t type;
uint16_t class;
uint32_t ttl;
uint16_t length;
char name[];
} __attribute__((packed)) dns_record_txt_t;
void parseArecord(dns_record_a_t* records,int i);
void parseTXTrecord(dns_record_txt_t* records,int i);
void saveXML();
#endif