1 目标
① 从字符串中提取IP子串
② 验证IP字符串是否合法(IPV4)
2 代码
① ip地址提取
/**
* @brief : IPv4地址提取
* @param in_ip : 待提取字符串
* @param len : 待提取字符串长度
* @param out_ip : 提取到的 IPv4 地址
* @return true : 提取成功
* false : 提取失败(IP地址不存在或不合法)
*/
bool ip_sub_get(const char *in_ip, int len, char *out_ip) {
int a,b,c,d;
const char *p = in_ip;
for(int i = 0; i < len; i