Skip to content

Commit

Permalink
remove unused dns record data/debug structures
Browse files Browse the repository at this point in the history
  • Loading branch information
mwarning committed Apr 20, 2021
1 parent fe9eda3 commit 5faddc5
Showing 1 changed file with 5 additions and 65 deletions.
70 changes: 5 additions & 65 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,37 +106,9 @@ union ResourceData {
struct {
uint8_t addr[4];
} a_record;
struct {
char* MName;
char* RName;
uint32_t serial;
uint32_t refresh;
uint32_t retry;
uint32_t expire;
uint32_t minimum;
} soa_record;
struct {
char *name;
} name_server_record;
struct {
char *name;
} cname_record;
struct {
char *name;
} ptr_record;
struct {
uint16_t preference;
char *exchange;
} mx_record;
struct {
uint8_t addr[16];
} aaaa_record;
struct {
uint16_t priority;
uint16_t weight;
uint16_t port;
char *target;
} srv_record;
};

/* Resource Record Section */
Expand Down Expand Up @@ -263,43 +235,6 @@ void print_resource_record(struct ResourceRecord* rr)

printf(" }");
break;
case NS_Resource_RecordType:
printf("Name Server Resource Record { name %s }",
rd->name_server_record.name
);
break;
case CNAME_Resource_RecordType:
printf("Canonical Name Resource Record { name %s }",
rd->cname_record.name
);
break;
case SOA_Resource_RecordType:
printf("SOA { MName '%s', RName '%s', serial %u, refresh %u, retry %u, expire %u, minimum %u }",
rd->soa_record.MName,
rd->soa_record.RName,
rd->soa_record.serial,
rd->soa_record.refresh,
rd->soa_record.retry,
rd->soa_record.expire,
rd->soa_record.minimum
);
break;
case PTR_Resource_RecordType:
printf("Pointer Resource Record { name '%s' }",
rd->ptr_record.name
);
break;
case MX_Resource_RecordType:
printf("Mail Exchange Record { preference %u, exchange '%s' }",
rd->mx_record.preference,
rd->mx_record.exchange
);
break;
case TXT_Resource_RecordType:
printf("Text Resource Record { txt_data '%s' }",
rd->txt_record.txt_data
);
break;
case AAAA_Resource_RecordType:
printf("AAAA Resource Record { address ");

Expand All @@ -308,6 +243,11 @@ void print_resource_record(struct ResourceRecord* rr)

printf(" }");
break;
case TXT_Resource_RecordType:
printf("Text Resource Record { txt_data '%s' }",
rd->txt_record.txt_data
);
break;
default:
printf("Unknown Resource Record { ??? }");
}
Expand Down

0 comments on commit 5faddc5

Please sign in to comment.