hash:=ex_val(res,'ret','',false);
=!re
=.id=*6
=name=wan-adsl
=mtu=1500
=mac-address=00:41:05:4F:82:DA
=arp=enabled
=disable-running-check=yes
=auto-negotiation=yes
=full-duplex=yes
=cable-settings=default
=speed=100Mbps
=running=yes
=slave=no
=comment=
=disabled=no
==
!re
=.id=*1
=name=ether1
=mtu=1500
=mac-address=00:0C:42:2D:80:06
=arp=enabled
=auto-negotiation=yes
=full-duplex=yes
=speed=100Mbps
=running=yes
=slave=no
=comment=
=disabled=no
=!re=.id=*3952
<...text here...>
=src-mac-address=00:1E:58:49:EF:F1
=agent-circuit-id=
==agent-remote-id
=
=XIпс=radius
=true
=dynamic
=tru=
=blocked=false
hm...Hello,
how to send this comando to router using api "/interface wireless access-list add mac-address=00:11:22:33:44:55 interface=AP-1 authentication=yes forwarding=no comment= TESTE"
/interface/wireless/access-list/add
mac-address=00:11:22:33:44:55
interface=AP-1
authentication=yes
forwarding=no
comment= TESTE
Well, is there any way to get ping response delay in ms? Is there an extra parameter to "/ping" to fetch full information?ping works differently using api, than usual ping in terminal
on api, you get result of how many pings sent, and how many you received back, so you have to set =count=<some number> allways
or it will run until you issue cancel command to cancel your ping.
Hello,Well, is there any way to get ping response delay in ms? Is there an extra parameter to "/ping" to fetch full information?ping works differently using api, than usual ping in terminal
on api, you get result of how many pings sent, and how many you received back, so you have to set =count=<some number> allways
or it will run until you issue cancel command to cancel your ping.
01/09/2012 11:56:58 - info 103 - connecting to 192.168.2.100
09.01.2012 11:56:58 - DEBUG 11001 - 192.168.2.100 tr_mkrouter.msend / login
09.01.2012 11:56:58 - DEBUG 11001 - 192.168.2.100 tr_mkrouter.msend / login
09.01.2012 11:56:58 - DEBUG 11001 - tr_mkrouter.msend = 192.168.2.100 name = admin
09.01.2012 11:56:58 - DEBUG 11001 - = 192.168.2.100 tr_mkrouter.msend response = 0072305e1275f4e0584561fb682e455939
01/09/2012 11:56:58 - # ERROR # 10008 - 192.168.2.100 tr_mkrouter.open opening router error =! Trap = message = can not log in
/system reboot works fine for me in a script on a 5.21 x86 box/system reboot in 5.21 requires interactive confirmation as does /system upgrade
/system auto-upgrade requires interactive password
Using ROS scripting you cannot respond to these requests, rendering all scripts that use these commands useless. The right way to fix the problem is eliminate the interactive confirmation, or bypass it when called from a script rather than the console. This would take work by MT.
Alternatively, could someone write a binary that can run on a router that can deal with this? I am not a coder so don't know what is involved.
/ppp/active/print
=.proplist=.id
?name=YOUR_NAME_HERE
/ppp/active/remove
=.id=YOUR_ID_HERE
[dcc32 Error] md5.pas(343): E2064 Left side cannot be assigned to
[dcc32 Fatal Error] api_studio.dpr(46): F2063 Could not compile used unit 'md5.pas'
function GetMD5(Buffer: Pointer; BufSize: Integer): string;
var
I : Integer;
MD5Digest : TMD5Digest;
MD5Context : TMD5Context;
begin
I := 0;
for I := 0 to 15 do
Byte(MD5Digest[I]) := I + 1; >>>>>>>>>> ERROR
MD5Init(MD5Context);
MD5UpdateBuffer(MD5Context, Buffer, BufSize);
MD5Final(MD5Digest, MD5Context);
Result := '';
for I := 0 to 15 do
Result := Result + IntToHex(Byte(MD5Digest[I]), 2);
end;
a type cast?..What is Byte() ?
Byte(MD5Digest[I]) := Byte(I + 1);
enpa:=encode_password(password,hash);
enpa:=encode_password(AnsiString(password),AnsiString(hash));
function TRouterOS.encode_password(passw, hash: Ansistring): string;
var
ac, temp: Ansistring;
pc: Array of ANSIChar;
i, lp: integer;
begin
if (hash<>'') and (passw<>'')
then begin
lp:=length(passw);
setlength(pc,1+lp+16);
pc[0]:=#0;
move(passw[1],pc[1],lp);
for i:=0 to 15
do begin
ac:=copy(hash,i*2+1,2);
if ac<>''
then pc[1+lp+i]:=AnsiChar(StrToInt('$' + ac));
end;
temp:=GetMD5(@pc[0], 1+lp+16);
end
else begin
temp:='#error#';
end;
result:=lowercase(temp);
end;
/ppp/secret/print
=.proplist=name
!re=name=marcelo
!re=name=xxxxxx
....
:global list "";
:foreach i in [/ppp active find] do={:if ([:find \
[/ppp active get $i name] "m"]=0) do={:set list ($list . "," . $i);}}; \
/ppp active print detail without-paging from $list;
DearYou first get all ppp secrets with "/ppp/secret/print", then get all online secrets with "/ppp/active/print", then you process the lists in your Delphi program, by excluding second list from the first
what exactly is not working? some errors or something?..Hello, I need to connect to mikrotik through Delphi 10.1 Berlin, and I'm not getting it, can anyone help me?
Units do not work.
/interface/monitor-traffic
=interface=wlan1
=.proplist=rx-bits-per-second,tx-bits-per-second