VOGONS


UniPCemu SLIP server releases

Topic actions

First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

Is there any way to convert data sent to the modem in data mode(SLIP or PPP data) and send/receive it to actual internet(with ISP emulation if needed) with some easy cross-platform library, like SDL(2)-net? I've built a simple modem emulator, and want to try connecting it to the internet in a cross-platform way (Windows, Linux, PSP and Android to start with). Maybe some ISP will need to be emulated, but if so, how? How does the ISP server respond to the sent/received data?

Can SDL_net be used, translating the requests to/from it in the application(UniPCemu) itself? So, strip the tcp(and/or ip) headers, use SDL to communicate(send packets), translate received data back to TCP/IP when received, receive the generated packet with the emulated modem? Or is that impossible?

Last edited by superfury on 2018-07-27, 12:01. Edited 2 times in total.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 38, by superfury

User metadata
Rank l33t++
Rank
l33t++

I'm wondering, now that I've gotten the modem emulation finally working correctly(based on Dosbox's softmodem.cpp), how does Dosbox even handle connecting to a Telnet server when using SDL(2)_net?

The Telemate seems to work without visible problems now.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 2 of 38, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've written a little simple support module for SDL(2)_net and connected it to my modem emulation(although compiling with SDL(2)_net is still untested code, if it compiles correctly). The basic framework is added and implemented into the modem emulation(basically a partial copy of the dosbox misc function module, but adjusted to not use C++ code, but plain C instead(no multiple connections are implemented, just 1-on-1 connections are used after all)).

Modem emulation: modem.c
Dosbox-based TCP library for the modem to use(based on Dosbox SVN r4036's misc_util.cpp ): tcphelper.c

Will TCPhelper.c work properly? Anyone can confirm if the code compiles correctly with SDL(2)_net(define SDL_NET or SDL2_NET to make it compile using it, otherwise it's a dummy interface)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 3 of 38, by superfury

User metadata
Rank l33t++
Rank
l33t++

After a bit of tinkering with the modem and tcphelper modules, I've finally gotten it to connect and talk properly to a BBS server 😁

429.jpg
Filename
429.jpg
File size
76.85 KiB
Views
1806 views
File comment
UniPCemu Connected to a BBS server on Windows.
File license
Fair use/fair dealing exception
430.jpg
Filename
430.jpg
File size
25.97 KiB
Views
1806 views
File comment
Leaving the BBS server.
File license
Fair use/fair dealing exception

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 4 of 38, by superfury

User metadata
Rank l33t++
Rank
l33t++

Somehow, the server doesn't seem to work properly? Sometimes(with two different ports used on the same PC for two instances of the emulator), the RING gets through, but the ATA fails afterwards(the other client says CONNECT)?

Modem emulation:https://bitbucket.org/superfury/unipcemu/src/ … dem.c?at=master
TCP client/server backend based on Dosbox: https://bitbucket.org/superfury/unipcemu/src/ … per.c?at=master

Can anyone see what's going wrong there? Why doesn't the server not always detect the connection attempt, as well as fail to acnowledge it(using modem_connect(NULL))?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 5 of 38, by superfury

User metadata
Rank l33t++
Rank
l33t++

After a bit of tinkering with the connection and ringing continuously while connected, I've managed to get it working over the localhost(127.0.0.1) address to make UniPCemu communicate with the other side! 😁

UniPCemu_-InterprocessCommunicationOverLocalhostIP.jpg
Filename
UniPCemu_-InterprocessCommunicationOverLocalhostIP.jpg
File size
141.98 KiB
Views
1778 views
File comment
UniPCemu programs communicating to each other over the localhost(127.0.0.1) address.
File license
Fair use/fair dealing exception

Although, the very first application that started can be connected to, the other can't be connected to from the first one(probably because the first application to start the server gets first dibs on the TCP port assignment, with the other being unable to start it's server on the same port). Although it should be solvable by making the two instances of UniPCemu use different port settings.

Edit: After retrying it, it's now properly connectable from both clients, so they can can call each other. I've also modified the ATH command to be able to hang up in two cases:
1: It's ringing, which terminates the ringing and disconnects the client connected to the server.
2: It's connected as a client/server, which terminates the connection and returns to server mode.

Although, this isn't the case on real machines, it's a handy hack to have(being able to shut down connections without accepting it).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 6 of 38, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just fixed input into the modem using a telnet program. Previously, it would echo the entire command back to the use while echo is enabled, but now it does so for every byte/character sent to the modem in command mode. That should make telnet programs be more usable(since they rely on echo for display).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 7 of 38, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie

Well done! That is a very nice feature to have for an emulator.

May I ask what BBS are you connected to?

YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/

Reply 8 of 38, by superfury

User metadata
Rank l33t++
Rank
l33t++

The two tested ones are the two mentioned at http://breakintochat.com/blog/2013/04/17/teln … osbox-emulator/ : bbs.starbase21.net and (in the screen capture) digitaldistortionbbs.com(the windows logo and goodbye text).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 9 of 38, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just managed to get it compiled(with SDL2_net) for Android, now, for some reason, both the server(port 23) and dialling(to any server) fails on Android(no carrier connecting from PC, no carrier connecting to BBS server). PC version works fine. Maybe some access rights on Android are required?

Edit: Looking at permissions of: https://github.com/gururise/dosbox/blob/maste … oidManifest.xml , I see: INTERNET and ACCESS_NETWORK_STATE . Could it be that those are required?

Edit: Googling a bit: https://developer.android.com/reference/andro … permission.html
INTERNET: Allows applications to open network sockets.
ACCESS_NETWORK_STATE: Allows applications to access information about networks.

Looks pretty crucial to me, since it uses sockets?
Edit: Added those, still no connections?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 10 of 38, by superfury

User metadata
Rank l33t++
Rank
l33t++

After a bit of messing around with the Android files(fixing issues and keys), I've managed to get it working on Android:

7-bbsfromAndroid1.jpg
Filename
7-bbsfromAndroid1.jpg
File size
139.77 KiB
Views
1738 views
File comment
Connecting using manual ATDT dialling.
File license
Fair use/fair dealing exception
8-bbsfromAndroid2.jpg
Filename
8-bbsfromAndroid2.jpg
File size
86.4 KiB
Views
1738 views
File comment
Disconnect from the BBS.
File license
Fair use/fair dealing exception

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 11 of 38, by superfury

User metadata
Rank l33t++
Rank
l33t++

There'd one odd thing now, though: the PC version can connect and be connected to(ATDT / RING+ATA succeeds), but ATDT from the PC to Android won't RING? So, for some reason, Android client is working, but the server isn't(listening)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 13 of 38, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just tried the higher port range(1123 for easy addition, while not conflicting with existing registered ports). It will properly connect to that port from the PC version of UniPCemu 😁

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 14 of 38, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just wondering, can you emulate an ISP over a TCP connection(which has a client that connects using the SLIP protocol), by:
- Use https://sourceforge.net/projects/combytcp/ to act as a server to pipe the TCP data from a virtual modem(e.g. Dosbox serial modem or UniPCemu's modem) to a virtual modem device(Setup normally using Windows).
- Bridge said modem to your LAN connection, thus acting as a ISP by sending said packets over the LAN/WAN

Would that work(using either Windows 10 as a host or 7 in a virtual machine(e.g. Virtualbox)? That way, you should have a simple ISP modem connection to connect to using e.g. Windows 95 or 3.11 which connects over the emulator's serial modem to the internet, even without betwork card(e.g. NE2000) emulated?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 15 of 38, by superfury

User metadata
Rank l33t++
Rank
l33t++

Gotten the modem and the TCP connection setup correctly, it seems. The only problem left seems to be actually bridging the virtual modem and LAN connection by use of connection sharing? Anyone knows how this can be done?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 16 of 38, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've tried adding a dummy serial port(COM1, which is fake according to the super i/o bios setting, with manual irq4 assignment), then adding said port to the modem list as an 54k modem, finally adding it to the windows 10 connections. But selecting the third tab give an 608 error(?).

Trying to connect said port to the TCP port by using COMbyTCP says it cannot connect(port is in use)?

How can I bridge said port(hardware port or maybe some virtual COM port) to the LAN? While still being able to connect to it by using an TCP connection?

Maybe connect said other virtual port to another by tunnelling software(com to com passthrough)? Is there a virtual com port allowing such a thing? com2com seems to do that, but while I can connect either to a TCP port, I can't seem to get Windows to somehow see the other one to be added to connect to the LAN? Or should that be possible?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 17 of 38, by superfury

User metadata
Rank l33t++
Rank
l33t++

I'm starting to think that it might be easier to build my own conversion from TCP SLIP <-> pcap i/o using UniPCemu's core(disabling all CPU and hardware emulation except SDL_net and modem base code, where the modem essentially is in auto-answer mode, when connected simply (un)packing slip packets received/sent from/to the connected host, and itself transferring/receiving those using pcap, ignoring all modem parameters and settings(except the TCP port to use as a server)?

UniPCemu's modem to use as a base for the TCP server: https://bitbucket.org/superfury/unipcemu/src/ … dem.c?at=master

And taking the packet send/receive logic from fake86's packet.c , injecting and adjusting it as a placeholder for the CPU(encoding received packets and sending them through slip, decoding received slip packets and sending them through pcap) might be easier?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 18 of 38, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've just finished building a rough conversion server on top of UniPCemu's serial(through TCP) server, which(when a valid network card is selected) should turn the emulated modem itself into a modem that can't connect(from software in the emulator) anywhere(so no outgoing calls or answers by the modem that the software can see), but which is instead acting as a server(the same way as the application sends and receives data, but implemented within UniPCemu itself) for up to one connection. When it's connected to, it enables the packet capture functionality, sending packets received through (Win)PCap using the SLIP protocol to the connected client, while receiving packets through the SLIP protocol, decoding the encoded SLIP packet into a raw packet(with automatically extending buffer in portions of 1KB by allocating a new buffer, moving the data and releasing the old buffer when the buffer is full, allowing for automatic enlargement of the buffer for up to a theoretical 4GB minus 1KB). When the SLIP packet finished by sending a SLIP END byte to the server, the server sends the received decoded packet(now in raw format, decoded from the inputted SLIP format) using (Win)PCap.

Although the format it sends and receives with are the default PCap format(no customizations on the PCap settings) and the packets sent to PCap and the client are the exact same values received from the other end(no packet reformatting is applied, so no e.g. TCP/IP to IP or Ethernet to IP conversion is applied in any way).

https://bitbucket.org/superfury/unipcemu/comm … 449feab59b008ed

Any thoughts on it? Is that a correct way of handling the packets?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 19 of 38, by superfury

User metadata
Rank l33t++
Rank
l33t++

I'm just wondering (having read https://www.binarytides.com/raw-sockets-packe … s-with-winpcap/ about the ethernet header, which UniPCemu doesn't add or remove when parsing from/to SLIP packets and sending/receiving through Winpcap).

Should anything special, like constructing(before the received decoded SLIP is being sent to the ethernet) or destructing(before encoding the SLIP packet to send to the connected client) the ethernet header be done? If so, how? Can it be done in a cross-platform way?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io