Skip to content

Commit ab8fbcb

Browse files
[WIP] Adapting ip address in the models struct
squash with 'defining interface settings in a struct' commit
1 parent 33d52ec commit ab8fbcb

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/settings/settings.h

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,22 @@ namespace models {
2626
char pwd[64]; // Max length of password is 63 + \0
2727
};
2828

29+
// this struct represents an ip address in its simplest form.
30+
// TODO should this stay here?
31+
// TODO it may be better to check for IPV6 compatibility to reduce size
32+
struct ip_addr {
33+
IPType type;
34+
union {
35+
uint8_t bytes[16];
36+
uint32_t dword[4];
37+
};
38+
};
39+
2940
struct EthernetSetting {
30-
uint32_t ip;
31-
uint32_t dns;
32-
uint32_t gateway;
33-
uint32_t netmask;
41+
ip_addr ip;
42+
ip_addr dns;
43+
ip_addr gateway;
44+
ip_addr netmask;
3445
unsigned long timeout;
3546
unsigned long response_timeout;
3647
};

0 commit comments

Comments
 (0)