vmps

As of version 2.0.0, the server also supports the VMPS protocol.

server vmps {
	listen {
		ipaddr = *
		port = 1589
		type = vmps
	#	interface = eth0
	}
	vmps {
		if (!VMPS-Mac) {
			if (VMPS-Ethernet-Frame =~ /0x.{12}(..)(..)(..)(..)(..)(..).*/) {
				update request {
					VMPS-Mac = "%{1}:%{2}:%{3}:%{4}:%{5}:%{6}"
				}
			}
			else {
				update request {
					VMPS-Mac = "%{VMPS-Cookie}"
				}
			}
		}
		#mac2vlan
		update reply {
			VMPS-Packet-Type = VMPS-Join-Response
			VMPS-Cookie = "%{VMPS-Mac}"

			VMPS-VLAN-Name = "please_use_real_vlan_here"
			#VMPS-VLAN-Name = "%{sql:select ... where mac='%{VMPS-Mac}'}"
		}
		if (VMPS-Packet-Type == VMPS-Reconfirm-Request){
			update reply {
				VMPS-Packet-Type := VMPS-Reconfirm-Response
			}
		}
	}
}