28 lines
295 B
C
28 lines
295 B
C
#ifndef IP_H
|
|
#define IP_H
|
|
|
|
#define Port uint16_t
|
|
|
|
struct IP {
|
|
|
|
uint32_t val;
|
|
|
|
/** empty ctor */
|
|
IP() : val(0) {
|
|
;
|
|
}
|
|
|
|
/** ctor with IP-string */
|
|
IP(const char* ipStr) {
|
|
set(ipStr);
|
|
}
|
|
|
|
/** set the IP */
|
|
void set(const char* ipStr) {
|
|
val = ipaddr_addr(ipStr);
|
|
}
|
|
|
|
};
|
|
|
|
#endif // IP_H
|