initial commit
This commit is contained in:
27
net/IP.h
Normal file
27
net/IP.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user