Comments (19)
from tik4net.
var redInterface = connection.LoadAll<InterfaceWireless>().First(wlan => wlan.Name == "red");
connection.Save(redInterface);
Have to say that I encountered many more problems with the library, including trap interrupted
exceptions a second after I start a sniff command, strangely without any unusual bytes sent to TCP 8728 compared to other libraries in different languages.
from tik4net.
Hi,
I am not sure which version of library/mikrotik do you use, but I am 100% sure that your example works like a charm. I am using various versions of mikrotiks, but for unitesting I am using 6.10 version (virtual image).
Instead of sniffer I would recommend you to hook OnWriteRow event on connection to see what is going to the mikrotik router. See https://github.com/danikf/tik4net/wiki/Communication-debugging-&-testing
And finaly - if you want to achieve "standard" library behavior with full control of communication, you can use pure connection commands - see https://github.com/danikf/tik4net/wiki/Low-level-API
BTW - 8728 is standard port for mikrotik API and 'trap interupted' is standard behavior when you send bad request :-)
As last point - there could be problem with encoding some exotic characters (names/comments) - see https://github.com/danikf/tik4net/wiki/How-to-use-tik4net-library#how-to-encode-non-ascii-characters.
D
from tik4net.
I think this problem is specific to Dbii's interfaces http://www.dbii.com/f36N-PRO.html
I'll try to find some answers and update
from tik4net.
Hi,
you can try to use lowlevel API or use "usedFieldsFilter" (last optional parameter in Save method) to specify fields you have modified (to avoid "full save").
D
from tik4net.
I'm using it now, but it's pretty ugly - it makes the user have to know the underlying strings, which is a bad idea for a wrapping library in my opinion.
from tik4net.
from tik4net.
I think I figured the cause of the interrupted
bug - both interfaces stop sniffing because of the done / interrupted response to the first one to finish (cancel).
I found that requesting a /cancel
for a specific tag returns a trap interrupted
for the tags of all the open sniffers. This is not the behavior in another library I use with a different language.
Do you have an idea on how to solve this? I know it is possible.
from tik4net.
from tik4net.
It is possible
from tik4net.
Hi,
not sure about sniffer (do you reallu use /tool/sniffer
?), but /tool/torch
seams to have "singleton" behavior by design.
- Started cmd1, cmd2 (
LoadAsync<ToolTorch>
) cmd2.Cancel
- Result: both cmd1 and cmd2 cancelled by mikrotik (
.tag
seams to be ignored)
And in console script it looks like:
/tool/torch
=interface=ether1
.tag=1
/tool/torch
=interface=wlan1
.tag=2
!re
.....
.....
/cancel
=.tag=2
!trap
=category=2
=message=interrupted
.tag=1
!trap
=category=2
=message=interrupted
.tag=2
!done
.tag=1
!done
.tag=2
So - one cancel
and two canceled commands ... And no exception/error callback from API. This is correct behavoir of API and understandable behavior of mikrotik router.
D
from tik4net.
Hi
when I'm trying to reset-counters im getting a 'no such command' error.
Please help, this is my code:
var cmd= connection.CreateCommandAndParameters("/tool/user-manager/user/reset-counters ", "?=numbers", txtreset.Text);
from tik4net.
Hi RaelKbg - please use your thread with proper name :-)
D
from tik4net.
Hi danikf
please specify. I used the same code to print where download-used > and it worked fine.
from tik4net.
Don't use Issue with name "Dbii Networks interface" dor discussion about different topic please ...
- see my comment in issue #27
D
from tik4net.
Hi,
Actually I use interface/wireless/sniffer/sniff
from tik4net.
? :-)
from tik4net.
Hi AsafMag
Im sorted thank you.
from tik4net.
About the sniffing cancellation - opened issue #35 , closing this one.
from tik4net.
Related Issues (20)
- Reboot/Shutdown causes IOException
- Support routerOS 7 ?
- DnsStatic entry with empty name results in an exception HOT 2
- TikEntityPropertyAccessor.ConvertFromString logic wrong for enum with mutiple flags set
- add user to radius server HOT 1
- Unhandled exception. System.IO.IOException: Can not read sentence from connection HOT 1
- IOException: Can not read sentence from connection HOT 1
- how ppp Active Connection remove HOT 2
- interfaces lists HOT 1
- Can I use them in Asp.net core mvc project version 6 dotnet
- Help vb.net or C# HOT 2
- LoadAsync with listen / follow HOT 2
- Connect via MAC Address?
- Add update all of information
- Interface Name of pppoe user
- Creación de Colas Simples HOT 1
- LoadAll method throwing exception System.FormatException: 'Value 'established,related,untracked' for property 'ConnectionState(connection-state)' is not in expected format
- Get id of any object HOT 1
- Execute script with FTP cause TikCommandUnexpectedResponseException HOT 1
- ExecuteScalarOrDefault: Sequence contains no matching element HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tik4net.