qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Send packet from qemu nic to host


From: Sarvesh Darak
Subject: Send packet from qemu nic to host
Date: Tue, 2 Apr 2024 15:19:10 +0530

Hi all,
I have implemented a basic nic model in qemu with a custom machine.
I am able to receive packets inside qemu from host using "echo "Hello from host" | nc -q 0 localhost 12345"
qemu command:
./qemu-system-aarch64 -machine my_machine,secure=on,enable-nw=on,netdev=net0 -cpu cortex-a55 -m 1024 -semihosting-config enable=on,target=native -netdev user,id=net0,hostfwd=tcp:127.0.0.1:12345-:80 -nographic

now i want to send packet from qemu to host. for that I am triggering a qtest
qts = qtest_init("-machine topaz-ultra,secure=on,enable-nw=on,netdev=net0 -cpu cortex-a55 -m 1024 -semihosting-config enable=on,target=native -netdev user,id=net0,hostfwd=tcp:127.0.0.1:12345-:80 -nographic");

this will trigger nic's tx function which calls

qemu_send_packet()
I suppose this function will send packet out on specified port.
trying to take a tcpdump on 12345 host port. I am not able to receive any packet.
Let me know what things are missing and what is the correct way to packet from qemu to host. I don't have any guest OS running.

Thanks & Regards.,

SD
note: I am crafting a broadcast packet inside nic itself to send out.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]