Page 1 of 1

Lua and Agent_Remote_ID

Posted: 03 Mar 2024, 19:45
by naldotrix
Hi, script lua not work with agent_remote_id

#!lua
function username(pkt)
return pkt:agent_circuit_id('')
end



[2024-03-03 16:40:07.862] ipoe1: 7f233c95614fadb9: send [DHCPv4 Ack xid=ce3ce20d ciaddr=100.64.115.3 yiaddr=100.64.115.3 chaddr=fc:40:09:4e:0f:00 <Message-Type Ack> <Server-ID 100.64.115.1> <Lease-Time 120> <T1 60> <T2 105> <Router 100.64.115.1> <Subnet 255.255.255.0> <DNS 8.8.8.8,1.1.1.1> <Relay-Agent {Agent-Circuit-ID d4c1.c812.1678 pon 1/1/14/5/26/1:1015} {Agent-Remote-ID ZTEGC437EED5}>]

[2024-03-03 16:41:06.630] ipoe0: 7f233c95614fadb8: send [DHCPv4 Ack xid=e55b81cc ciaddr=100.64.115.2 yiaddr=100.64.115.2 chaddr=c0:b1:01:e8:06:9d <Message-Type Ack> <Server-ID 100.64.115.1> <Lease-Time 120> <T1 60> <T2 105> <Router 100.64.115.1> <Subnet 255.255.255.0> <DNS 8.8.8.8,1.1.1.1> <Relay-Agent {Agent-Circuit-ID d4c1.c812.1678 pon 1/1/16/3/01/1:1015} {Agent-Remote-ID ZTEGC8F8628F}>]



accel-cmd show sessions
ifname | username | calling-sid | ip | type | comp | state | uptime
--------+----------+-------------------+--------------+------+------+--------+----------
ipoe0 | | c0:b1:01:e8:06:9d | 100.64.115.2 | ipoe | | active | 00:09:57
ipoe1 | | fc:40:09:4e:0f:00 | 100.64.115.3 | ipoe | | active | 00:09:57

Re: Lua and Agent_Remote_ID

Posted: 04 Mar 2024, 18:51
by dimka88
Hi, why do you use quotes as arg in func?
Try pkt:agent_circuit_id(). Also what about string unpacking?
Look Agent-Circuit-ID contain to match special characters including spaces d4c1.c812.1678 pon 1/1/16/3/01/1:1015