winpcap on linux - linux

I am trying to port an Windows executable to Linux using wine. I am at a point where I can run the executables but it returns some error saying it can't load "npf" driver. Is there a way to also port winpcap on Linux? The application I was trying to port is depending on winpcap library.
Thanks

libpcap? It is the original version of pcap that was then made into winpcap...

winpcap depends on the custom Windows drivers to provide access to the raw streams, it's not possible to port that as-is to wine.

winpcap is essentially a set of a Windows driver and two DLL's, wich enables applications to send&receive raw network packets to&from the network cards, and originally was a tool to have the same features than tcdump in Uxix/Linux in WIndows.
So, maybe a solution a wrapper in Linux of the "libpcap(capture) and libnet(send)" libraries, providing a winpcap binary compatibility? Playonlinux guys can help?

Related

Simulink Real-Time Library linux

I'm trying to work with a co-simulator that communicates with Simulink using UDP packets. The problem is that in my Matlab installation I can't find the necessary library (Simulink real-time).
I read carefully each Matlab components during the installation but on Linux that library isn't present, on windows instead there is.
The missing block is this one here. Is there an alternative for that block available also for linux or where can I find this library?
Thanks

how to save a linux kernel and modules for use in other distro

Long story short, I bought a pre-installed linux laptop and would like to be able to run other linux distros, but use the same linux drivers w/ other distro so as to have all my hardware work flawlessly as it does with the custom linux Ubuntu 14.04 LTS.
If I could save or copy all of my hardware drivers someplace to reinstall once I've got a new linux distro installed.
So far I think the answer lays in compiling a linux kernel and modules from my running linux laptop, and try to get flashed in my new linux distro that I'm installing. Not sure if that will work? or is the easiest method.
Any help or ideas would be greatly appreciated.
i just want my linux workstation hardware to work as good as it does w/ Ubuntu 14.04, with any linux distro I choose to try.
Thanks in advance
A bit weired, but, as far as I gnow:
you can do the thing you ask for to customize the same distribution.
"Compiling a linux kernel and modules from my running linux laptop": You said the running one, so You can pick it instead directly from "/boot/vmlinuz-KERNEL_VERSION
"If I could save or copy all of my hardware driver": You can copy the content of "/lib/modules/KERNEL_VERSION" folder in the same emplacement in the target. This folder contains kernel modules, among others, device drivers.
After having these in place, you can make the drivers working with "modprobe", you should have a list for all modules (you might use "lsmod" in the original system) and load them one by one or find a way that manage to load them all at once for you; in CentOS, there is a scrpit "/etc/rc.d/rc.sysinit" that can among other stuffs, do that for you.
I really wonder why you are worried about drivers on Linux distributions, coz, as far as I know, they are really good when it comes to device drivers.

How to start off with a embedded linux development environment

I come from a windows background and i am proficient with the .net platform. For work, i need to bring up a custom embedded system platform. We have bought the pandaboard ES as the test platform. The application is to stream images over the wifi. If you think about it, we are building something similar to a netgear router - the only difference being when you log into the device it serves images.
Because my background is in windows i am not quite sure how to start off with embedded linux development. in reading through various sites i have come to the conclusion that going to linux as development host is the best option.
Can some one point to me in the right direction regarding the set up. I have a windows machine that will be used for development purposes. I can either do a virtual box or setup a partition for linux. But the finer details are what throwing me off..what i need to know is
1) once i install linux what other software do I need - Code blocks,
2) what about toolchain
3) How to debug - through serial port ?
4) Is there a way to send the image built directly to the CF card?
Thanks
i suggest you to install linux on your desktop or laptop, perhaps
In a virtual machine.
Then, learn to compile on the command line (the order of program arguments to gcc is important).
Start an editor like emacs. Take half an hour to follow its tutorial.
Edit the helloworld.c file.
Compile it with
gcc -Wall -g helloworld.c -o hello
Improve it till no warnings are given.
Use
./hello
To run it.
Learn to use make with your own Makefile.
Use a version control system like git.
Learn to use cross compilation tools.
addenda
See also my answer here and also this answer.
Cross-building is not very different from native Linux building, except for the names of the cross-compilation tools.
But my feeling is that installing Linux and learning to develop Linux applications on Linux will teach you a lot of skills necessary for cross-development targeted for embedded Linux systems. So read material about Advanved Linux Programming and Advanced Unix Programming.
Remote debugging thru the serial port should be possible.

RPC from Windows to linux

Is there some (working) example how to create RPC from windows to linux?
Client should be windows NT application, server is linux.
It needs to be MSRPC.
No Corba, no XML-RPC, SUN-RPC etc
MSDN says this:
RPC can be used in all client/server applications based on Windows
operating systems. It can also be used to create client and server
programs for heterogeneous network environments that include such
operating systems as Unix and Apple.
Unfortunately after spending few hours on google I'm giving up.
My expectation:
Linux node should have samba installed, because their MSRPC implementation works.
Using IDL file I generate stubs for both client and server
Client is built using MSVC
Server is build using gcc with some includes/libraries from samba (or other libs)
Linux node must have such RPC port mapper
Can someone point me out?
I think you have 2 possible ways to deal with this:
1- You can try using DCOM with wine, which means that you will actually write your code for windows, but at the same time you can test your results in the process and avoid using WinAPI calls that wine is not able to handle properly. This approach will allow you to generate stubs code from your IDL files.
2- You can try using Samba RPC Pluggable Modules, but I am afraid in this case the RPC communication will be more primitive.
Edit:
It seems there are many other ways. I found a list of libraries in DCOM-Wikipedia, j-Interop for example looks particularly promising.

Can you Run Xcode in Linux?

Can you run Xcode in Linux? Mac OS X was based on BSD Unix, so is it possible?
From what I have heard, there is a MonoDevelop plugin that has an iPhone simulator.
The low-level toolchain for Xcode (the gcc compiler family, the gdb debugger, etc.) is all open source and common to Unix and Linux platforms. But the IDE--the editor, project management, indexing, navigation, build system, graphical debugger, visual data modeling, SCM system, refactoring, project snapshots, etc.--is a Mac OS X Cocoa application, and is not portable.
Nobody suggested Vagrant yet, so here it is, Vagrant box for OSX
vagrant init AndrewDryga/vagrant-box-osx --box-version 0.2.1
vagrant up
# editor's notes:
# - this requires virtualbox
# - version 0.3.1 (2016) is down now, so version 0.2.1 (2015)
# - there are notes for building an image one's self at the site
and you have a MACOS virtual machine. But according to Apple's EULA, you still need to run it on MacOS hardware :D But anywhere, here's one to all of you geeks who wiped MacOS and installed Ubuntu :D
Unfortunately, you can't run the editors from inside using SSH X-forwarding option.
I really wanted to comment, not answer. But just to be precise, OSX is not based on BSD, it is an evolution of NeXTStep. The NeXTStep OS utilizes the Mach kernel developed by CMU. It was originally designed as a MicroKernel, but due to performance constraints, they eventually decided they needed to include the Unix portion of the API into the kernel itself and so a BSD-compatible "server" (originally intended to process requests for BSD-compatible kernel messages) was moved into the kernel, making it a Monolithic kernel. It may be BSD compatible in the programming API, but it is NOT BSD.
The rest of the OS involved ObjectiveC (under arrangements between Stepstone and Richard Stallman of GNU/GCC) with a GUI based on a technology called "Display Postscript" ... sort of like an X Server, but with postscript commands. OS X changed Display Postscript to Display PDF, and increased the general hardware requirements 1000 fold (NeXT could run in 8-16MB, now you need GB).
Due to the close marriage of GCC and Objective C and NeXT, your best bet at running XCode natively under Linux would be to do a port (if you can get ahold of the source - good luck) utilizing the GNUStep libraries. Originally designed for NextStep and then OpenStep compatibility, I've heard they are now more-or-less Cocoa compatible, but I've not played with any of it in almost 2 decades. Of course that only gets you as far as ObjC, not Swift, and I don't know if Apple is going to OpenSource it.
You can run Xcode on Linux NATIVELY using Darling:
Darling is a translation layer that lets you run macOS software on Linux
Once installed you can install Xcode via command-line developer tool following this link.
If you run VMware Player or Workstation (or maybe VirtualBox, I'm not sure if it supports Mac OS X, but may), and then Mac OS X Server (Client can't legally be virtualized). Of course, in this case you are running XCode on OS X, but your host machine could be linux.
If you cannot shell out thousands of dollars for a decent Mac then there is an option to run OSX and XCode in the cloud:
http://www.macincloud.com/
I think you need MonoTouch (not free!) for that plugin.
And no, there is no way to run Xcode on Linux.
Sorry for all the bad news. :)
Nope, you've heard of MonoTouch which is a .NET/mono environment for iPhone development. But you still need a Mac and the official iPhone SDK. And the emulator is the official apple one, this acts as a separate IDE and allows you to not have to code in Objective C, rather you code in c#
It's an interesting project to say the least....
EDIT: apparently, you can distribute on the app store now, early on that was a no go....
The easiest option to do that is running a VM with a OSX copy.
It was weird that no one suggested KVM.
It is gonna provide you almost native performance and it is built-in Linux.
Go and check it out.
you will feel like u are using mac only and then install Xcode there
u may even choose to directly boot into the OSX GUI instead of Linux one on startup
If you really want to use Xcode on linux you could get Virtual Box and install Hackintosh on a VM.
Edit: Virtual Box Guest Additions is not supported with MacOS Movaje. You will want to use VMware
https://www.vmware.com/
https://hackintosh.com/
If you want XCode on another OS, I suggest cloud computing. That way your app is being developed on a Mac and can be submitted to the App Store.
Use quiling framework
For more info check at https://github.com/qilingframework/qiling
I think it is the best
Maybe you can use Virtual Machine and Qiling framework.
If you are planning to use a Mac VM on Linux, check out Docker-OSX. It provides a simple approach to use pre-built Mac VMs with Docker.
To know more about the legality of running Apple software on non-Apple hardware, read this article: Is Hackintosh, OSX-KVM, or Docker-OSX legal?
OSX is based on BSD, not Linux. You cannot run Xcode on a Linux machine.

Resources