Open rincebrain opened 11 years ago
Yes, we first need to check if we can compile non-OS specific parts. Should we compile with Cygwin/mingw32 or with Visual Studio?
We can have a look at OpenLLDP support: http://openlldp.cvs.sourceforge.net/viewvc/openlldp/openlldp/src/platform/framehandlers/windows/lldp_windows_framer.c?revision=1.2&view=markup
I had meant with VS, but either way, really. I just thought VS would be easier since I think you'd need to use either pcap or NDIS-specific calls to do layer 2 traffic on Windows, and I don't know how playing with WinPcap through Cygwin/MinGW works.
I'm going to stub out the syslog calls with a thing that just spits them to a text file for now, and possibly upgrade that to logging to Event Viewer later, and go from there...
I cannot be sure but everything that can be done with VS should work with MinGW. And because there is no POSIX layer, making lldpd compile with VS will be more difficult: syslog, socket handling, chroot, privilege separation, ...
You're right - I looked at doing this in VS versus MinGW, and it's much saner with MinGW, so I'll start banging my head there.
Two unfortunate things. 1) The code in OpenLLDP has severely bitrotted - it no longer compiles and runs on Windows (and I'm not certain it ever did? there are some questionable notes in the changelog for those commits), and it looks like it was heavily pillaged from a combination of the Open1X codebase and the example NDIS 5.x driver. 2) MinGW doesn't give you syslog/socket/etc either, which may have been what you were alluding to above.
I thought that MinGW was just Cygwin without the DLL. About VS, lldpd is using some parts of C99. If I remember correctly, VS does not support C99. So it may also raise some problems.
Also please note that Windows8 and later (2012 and later) include LLDP protocol driver but its not installed by default. http://msdn.microsoft.com/en-us/library/windows/hardware/hh451627(v=vs.85).aspx I never able install it manually only on preview releases it was installed by default, they seems to using it with Data Center Bridging
@nshopik Somehow, I missed your comment. Did you get a chance to test it? What info does it export?
iirc remember they only shared link configuration only. Maybe it was changed, but quick test on Windows 2012 show that i still can't install it manually (probably only installed as part of DCB). This need to be re-tested on W10
All Windows 8+ boxes I've seen have LLDP installed by default. Unfortunately, it's fairly useless and not configurable.
I'd absolutely love to be able to deploy lldpd as an MSI and configure it via Group Policy.
Unfortunately, that's not an easy task. When I looked two years ago, I tried to sort out the POSIX part (syslog, sockets, etc.) before trying to handle the network part. I think the network part would be "easy" (looking at how this is done in other projects using raw sockets). It's the other part which can be hard.
I just have a branch with the work started a bit (only syslog has been implemented). I don't remember if I stopped because I didn't have more time or if there was some showstopper. It's possible I didn't know how to replace the Unix socket.
Another reason I would have preferred MinGW is that I can compile directly from Linux. Compiling from Windows would be a pain, even after setting up SSH access and stuff like that.
I understand, really I'm just frustrated with Microsoft over the Windows 8 thing.
Soon, a course of action could be to leverage Windows Linux subsystem: http://blog.dustinkirkland.com/2016/03/ubuntu-on-windows.html. I don't expect it to make lldpd work out of the box, but I suppose it would only leave a few gaps to implement.
This just got posted to Reddit: https://github.com/raspi/WinLLDPService
That's great!
It'd be nice to have a cross-platform tool that plays nice on Windows, as well.
Of course, since your options are terrible NDIS calls or WinPcap, that would be a bit of complexity, but given the interface-$OS.c already extant, what's one more domain-specific file? ;)
(I'll probably give a go to at least getting most of it compiling under Windows before I try to crap out some Win-specific code, I just wanted to file an issue about it as well to track anyone else's progress, including mine!)