将本地UDP服务器信息导入c ++ [英] Getting local UDP server information into c++

查看:206
本文介绍了将本地UDP服务器信息导入c ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我得到这个程序运行在我的mac,ipMidi,允许我通过我的以太网连接发送midi事件。
它在UDP协议下工作,并从我的Ableton Live daw发送midi。
我试图在同一台机器上运行ipMidi,从ipMidi的包到我的C + +程序,但我不知道如何做到这一点。
我一直在做研究一段时间知道,我只是不知道如何获得ipMidi发送包到我的本地主机或嗅探包通过我的以太网。
我发现的工具之一是route,但是我不能设法复制ip表条目发送包到我的监听UDP程序。
我发现这样做的其他方法是使我的程序加入一个多播组在目标ip和端口的目标包从我从ipmidi与wireshark嗅探的内核,但这是不可能的原因绑定告诉我正在使用的地址。
所以我真的可以使用一些帮助。



没有代码,我知道,但更像是一个理论的东西,而不是实现的问题。



我解释清楚,我的英语不是最好的。



感谢您的时间。

解决方案

看来你对不同的技术开放。我不是一个网络专家,我不是所有的专家与iptables,但我会尝试寻找一个三通等效为iptable。我发现这个连结可能对您有用。



http://unix.stackexchange.com/questions/15870/iptables-port-mirroring



编辑:另一个可能有用的
http://www.bjou。 de / blog / 2008/05 / howto-copyteeclone-network-traffic-using-iptables /



我想到的另一个攻击是,如果您可以控制ipMidi发送数据包的位置,您可以将它们发送到某个端口上的localhost, netcat 打开以侦听该端口,然后使用 tee 重定向文件上的输出并使用C ++程序读取该文件。 tee 的输出将再次转到 netcat ,它可以发送您喜欢的数据(另一个主机)。



如下:

  ipMidi  - > localhost  - > nc listening  - > tee  - > nc sending  - > destination 
- >文件 - >你的程序。

但是这只是一个想法,如果没有人提供更好的解决方案p>

So, I got this program running on my mac, ipMidi, that allows me to send midi events through my ethernet connection. It works under UDP protocol and is sending midi from my Ableton Live daw. I'm trying to read, in the same machine that is running ipMidi, the packages from ipMidi into my C++ program, but I can't figure out how to do this. I've been doing research for some time know and I just can't figure out how to get the ipMidi to send the packages to my local host or to sniff the packages going through my ethernet. One of the tools that I found out was route, but I can't manage to duplicate the ip table entry to send the packages to my listening UDP program. Other way that I find to do this was to make my program join a multicast group on the kernel i n the destination ip and port from the destination package I sniffed from ipMidi with wireshark, but this isn't possible cause the bind tells me that the address is being used. So I really could use some help on this.

There's no code, I know, but is more like a theoretical thing than and implementation problem.

Hope I explained myself clearly, my english isn't the best.

Thanks for your time.

解决方案

It seems that you are open to different techniques. I am not a networking expert, and I am not at all expert with iptables, but I would try to look for a "tee" equivalent for iptable. I found this link that may be useful to you.

http://unix.stackexchange.com/questions/15870/iptables-port-mirroring

EDIT: another one that could be useful http://www.bjou.de/blog/2008/05/howto-copyteeclone-network-traffic-using-iptables/

Another hack it comes into my mind is that, if you can control where the ipMidi sends the packet, you can send them to localhost on a certain port, having netcat open to listen on that port, then using tee to redirect the output on a file and read that file with your C++ program. The output of tee would to, again, to netcat which could send the data where you like (another host).

It would be like:

ipMidi -> localhost -> nc listening -> tee -> nc sending -> destination
                                           -> file -> your program.

But this is just an idea to try if nobody comes with a better solution (unlikely).

这篇关于将本地UDP服务器信息导入c ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆