1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- // inet4s.h : iface ... inet static
- //
- #if !defined(AGD_INET4S_H__8DD9BEA3_89E3_42BA_88AC_9D805D2CAEBC__INCLUDED_)
- #define AGD_INET4S_H__8DD9BEA3_89E3_42BA_88AC_9D805D2CAEBC__INCLUDED_
- #include <string.h>
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <linux/if_packet.h>
- #include <net/if_arp.h>
- #include <vector>
- #include <string>
- /////////////////////////////////////////////////////////////////////////////
- // inet4s.h - Declarations:
- typedef struct _IFACE_INET_STATIC
- {
- _IFACE_INET_STATIC(){_reset();}
- void _reset(void)
- {
- addr.s_addr = INADDR_ANY;
- gate.s_addr = INADDR_ANY;
- bcast.s_addr = INADDR_ANY;
- pointopoint.s_addr = INADDR_ANY;
- netmask.s_addr = INADDR_ANY;
- memset(&namesvr, 0, sizeof(namesvr));
- netprefix = 0;
- bcastOpt = 0;
- metric = -1;
- mtu = -1;
- hwaddr.clear();
- scope.clear();
- dnss.clear();
- }
- struct in_addr addr;
- struct in_addr netmask;
- struct in_addr gate;
- struct in_addr bcast;
- struct in_addr pointopoint;
- struct in_addr namesvr[3];
- unsigned int netprefix;
- int bcastOpt;
- int metric;
- int mtu;
- std::string hwaddr;
- std::string scope;
- std::vector<std::string> dnss;
- }IFACE_INET_STATIC, *LPIFACE_INET_STATIC;
- typedef const IFACE_INET_STATIC *LPCIFACE_INET_STATIC;
- bool ParseIfaceInet4sParam(const std::vector<std::string> &v, IFACE_INET_STATIC &is);
- bool WriteIfaceInet4sParam(FILE *pf, const IFACE_INET_STATIC &is);
- /////////////////////////////////////////////////////////////////////////////
- #endif // !defined(AGD_INET4S_H__8DD9BEA3_89E3_42BA_88AC_9D805D2CAEBC__INCLUDED_)
|