You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in artnet_net_recv() this check is make:
if (cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr ||
ntohl(cliAddr.sin_addr.s_addr) == LOOPBACK_IP) {
p->length = 0;
return ARTNET_EOK;
}
this prevent to use a node that is bound on the 0.0.0.0:6454 address:port...
in your opinion what check can be done to avoid returning at this stage....
I'm trying to make D::Light and Capture Polar working on the same computer....
I register an ArtNet node in DL as a server with artnet_new(), artnet_init(), and so...
I set the long Name, etc...
when I send an ArtPoll, I don't want to see the node I've created to be listed...
this can be done by:
if (((cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr) && !memcmp(p->data.ar.longname, n->state.long_name, ARTNET_LONG_NAME_LENGTH * sizeof(uint8_t))) ||
ntohl(cliAddr.sin_addr.s_addr) == LOOPBACK_IP) {
p->length = 0;
return ARTNET_EOK;
}
but I would like to know for a more elegant way....
in case of DL and Capture Polar on the same computer, cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr
Let me make sure I understand:
You want to respond to messages send from the same machine, except you also don't want the local node to show up when you try to discover devices?
To do the former you'll need to introduce a new function to control this behavior since we don't want to break existing clients. Something like
artnet_allow_loopback(artnet_node, bool);
There is no good way to filter Polls / PoolReplies from the same node. Comparing the node name is a bit of a hack, esp. since it could be set from the hostname. At a minimum I'd compare the manufacturer ID and the name
Let me make sure I understand:
You want to respond to messages send from the same machine, except you
also don't want the local node to show up when you try to discover devices?
that is exactly it!
DL and the 3D visualizer runs on the same host, and when I send a poll, I
don't want DL to be listed
To do the former you'll need to introduce a new function to control this
behavior since we don't want to break existing clients. Something like
artnet_allow_loopback(artnet_node, bool);
There is no good way to filter Polls / PoolReplies from the same node.
Comparing the node name is a bit of a hack, esp. since it could be set from
the hostname. At a minimum I'd compare the manufacturer ID and the name
do you mean something like that?:
if (((cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr) &&
!artnet_allow_loopback(artnet_node, bool))||
ntohl(cliAddr.sin_addr.s_addr) == LOOPBACK_IP) {
p->length = 0;
return ARTNET_EOK;
}
++
Nico
—
Reply to this email directly or view it on GitHub #4 (comment)
.
i) add a new bool to the node_state_t struct to track if loopback is enabled / disabled. It should default to disabled.
ii) add a artnet_allow_loopback function to toggle this state
iii) In artnet_net_recv, if loopback is disabled, and (cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr || ntohl(cliAddr.sin_addr.s_addr) == LOOPBACK_IP ) the packet should be skipped
iv) In handle_reply if the node name and the manufacturer match our name and the packet was send from this machine the poll reply is discarded.
i) add a new bool to the node_state_t struct to track if loopback is
enabled / disabled. It should default to disabled.
ii) add a artnet_allow_loopback function to toggle this state
iii) In artnet_net_recv, if loopback is disabled, and
(cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr ||
ntohl(cliAddr.sin_addr.s_addr) == LOOPBACK_IP ) the packet should be skipped
iv) In handle_reply if the node name and the manufacturer match our name
and the packet was send from this machine the poll reply is discarded.
—
Reply to this email directly or view it on GitHub #4 (comment)
.
Activity
sl1200mk2 commentedon Apr 22, 2014
this one i sa stopper too...
can't we check for p->data.ar.longname != n->state.long_name or something else?
++
nomis52 commentedon Apr 23, 2014
Try removing the check.
sl1200mk2 commentedon Apr 23, 2014
if I remove the check I got my own node address (e.g the libartnet server)...
nomis52 commentedon Apr 23, 2014
I'm not clear what you're asking for. Can you please clearly describe the problem and what you'd like to see.
sl1200mk2 commentedon Apr 23, 2014
I'm trying to make D::Light and Capture Polar working on the same computer....
I register an ArtNet node in DL as a server with artnet_new(), artnet_init(), and so...
I set the long Name, etc...
when I send an ArtPoll, I don't want to see the node I've created to be listed...
this can be done by:
if (((cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr) && !memcmp(p->data.ar.longname, n->state.long_name, ARTNET_LONG_NAME_LENGTH * sizeof(uint8_t))) ||
ntohl(cliAddr.sin_addr.s_addr) == LOOPBACK_IP) {
p->length = 0;
return ARTNET_EOK;
}
but I would like to know for a more elegant way....
in case of DL and Capture Polar on the same computer, cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr
best regards,
++
nomis52 commentedon Jun 13, 2014
Let me make sure I understand:
You want to respond to messages send from the same machine, except you also don't want the local node to show up when you try to discover devices?
To do the former you'll need to introduce a new function to control this behavior since we don't want to break existing clients. Something like
artnet_allow_loopback(artnet_node, bool);
There is no good way to filter Polls / PoolReplies from the same node. Comparing the node name is a bit of a hack, esp. since it could be set from the hostname. At a minimum I'd compare the manufacturer ID and the name
sl1200mk2 commentedon Jun 13, 2014
Simon,
thank you for taking time to answer me!
2014-06-13 4:42 GMT+02:00 Simon Newton notifications@github.com:
that is exactly it!
DL and the 3D visualizer runs on the same host, and when I send a poll, I
don't want DL to be listed
++
Nico
nomis52 commentedon Jun 13, 2014
Here are the steps:
i) add a new bool to the node_state_t struct to track if loopback is enabled / disabled. It should default to disabled.
ii) add a artnet_allow_loopback function to toggle this state
iii) In artnet_net_recv, if loopback is disabled, and (cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr || ntohl(cliAddr.sin_addr.s_addr) == LOOPBACK_IP ) the packet should be skipped
iv) In handle_reply if the node name and the manufacturer match our name and the packet was send from this machine the poll reply is discarded.
sl1200mk2 commentedon Jun 14, 2014
thanx,
will be on my todo list.
++
2014-06-13 17:29 GMT+02:00 Simon Newton notifications@github.com: