Author Topic: Raw Ethernet I/O from an OS/2 application  (Read 3885 times)

John Wilson

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Raw Ethernet I/O from an OS/2 application
« on: April 23, 2023, 08:53:47 pm »
Is there a reasonable way to do raw Ethernet I/O (for using non-TCP/IP protocols) from a user-mode application?  Something equivalent to the DOS Packet Driver interface or Linux's PF_PACKET would be great, but a BPF/libpcap/WinPcap-style thing is good enough too.  I also need to be able to change my MAC address (which might be upsetting to the local TCP/IP stack's ARP layer if it isn't wired for that) and multicast address list, or at least set up promiscuous mode so I can *pretend* to do those things.  No idea where to look!  I hope it doesn't mean writing a cooperating fake network driver (like WinPcap) because that has quite a learning curve ... but if that's the only choice, OK.  If it matters:  my application is a minicomputer emulator, which can emulate a minicomputer Ethernet port so the minicomputer OS can run old-fashioned networking protocols (most likely DECnet).  Ethernet has long been a missing piece in my OS/2 build.  Thanks / JW

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4805
  • Karma: +99/-1
    • View Profile
Re: Raw Ethernet I/O from an OS/2 application
« Reply #1 on: April 24, 2023, 12:13:43 am »
Hi John, welcome.
As far as I know, we can't change the MAC address.
There is a port of libpcap, https://hobbes.nmsu.edu/download/pub/os2/dev/libraries/misc/lpcap_0-4a.zip with other dependencies also on Hobbes. Not sure about any others.

Neil Waldhauer

  • Hero Member
  • *****
  • Posts: 1027
  • Karma: +24/-0
    • View Profile
    • Blonde Guy
Re: Raw Ethernet I/O from an OS/2 application
« Reply #2 on: April 24, 2023, 03:31:15 am »
Kermit/2 for OS/2 supports DECnet in conjunction with DEC's PATHWORKS For OS/2 product version 2.3 or later. I wonder how they do it?

https://kermitproject.org/k95manual/os2k95.html
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

John Wilson

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Raw Ethernet I/O from an OS/2 application
« Reply #3 on: April 24, 2023, 06:35:06 am »
Interesting point about PATHWORKS!  OK I grabbed libpcap and it depends on ipspy.dll, which looks much more like what I want.  Seems like the .DLL itself might be closed-source though, so I can't do what it does, but at least I can call the DLL and maybe get what I need.  Thank you guys!

Andi B.

  • Hero Member
  • *****
  • Posts: 817
  • Karma: +11/-2
    • View Profile
Re: Raw Ethernet I/O from an OS/2 application
« Reply #4 on: April 24, 2023, 09:38:55 am »
MAC address change - some network drivers allow to set it (MPTS [NAPS] - Parameters - ). Needs a reboot. If you mean changing on the fly - I don't know.