var psrc = $('input[name="psrc"]').val()
var hwsrc = $('input[name="hwsrc"]').val()
var pdst = $('input[name="pdst"]').val()
var hwdst = $('input[name="hwdst"]').val()
var re = /^(d{1,2}|1dd|2[0-4]d|25[0-5]).(d{1,2}|1dd|2[0-4]d|25[0-5]).(d{1,2}|1dd|2[0-4]d|25[0-5]).(d{1,2}|1dd|2[0-4]d|25[0-5])$/;
var reg=/[A-Fa-fd]{2}:[A-Fa-fd]{2}:[A-Fa-fd]{2}:[A-Fa-fd]{2}:[A-Fa-fd]{2}:[A-Fa-fd]{2}/;
if(!psrc && !re.test(psrc)){
alert('源IP不合法!');
return
}
if(!hwsrc && !reg.test(hwsrc)){
alert('源MAC不合法!');
return
}
if(!pdst && !re.test(pdst)){
alert('目的IP不合法!');
return
}
if(!hwdst && !reg.test(hwdst)){
alert('目的MAC不合法!');
return
}