@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11



Comments:

<0> iocr
<0> wtf is that
<0> ;/
<1> iocp is meant to be hugely scalable for hardcore servers with tons of ram and multi cpu etc
<1> IO completion routine
<0> http://www.codeproject.com/internet/IOCPNet.asp
<1> compared to IO completion port
<0> oh
<1> iocr is a general purpose asynch notifier. meshes well with other multiplexed resources.
<1> iocp is specialized, only compatible with network, meant to be used with a thread pool.
<0> threads omgoosh...
<2> omigawd
<2> hmm
<1> it mainly insulates you from the threads themselves. it manages them.'
<1> iocp's that is
<3> daxxar, still there?



<3> that's the example
<4> jeffloc, I think you've misunderstood me slightly. Allow me to explain again.
<3> ok
<4> jeffloc, I have a host A and a host B. A has two (or more) IPs ***igned to it, B has a single. The application on A listens on INADDR_ANY for inbound UDP data. The application on B sends a UDP packet to IP1 on host A. Now, when host B responds, I need to be certain it's responding from IP1, and not from IP2 (or any other IP).
<4> But currently, without doing any binding on the reply-part, it just picks a "random" IP, and to ***ign it to one, I have to bind, but to bind, I need to know what IP that host B sent data to. (i.e. where the recvfrom()'ed data was targeted to)
<3> it will respond through whatever interface it recieves the message through
<3> usually
<1> how could it possibly know which one that is?
<5> By checking the UDP header? *runs*
<4> AaronWL, it's in the IP header?
<5> Er yeah, IP header.
<4> AaronWL, using IP_PKTINFO allows you to get it, e.g.
<4> (socket option)
<1> ah, i didnt know that.
<1> well, most apps ive seen this tend to use binding or raw sockets, often because they need this for some other reason.
<3> you could easily split that example into two and run them on different computers
<4> Mh, yeah.
<1> eg, they need to handle different interfaces differently, or they need more information about the packet
<4> jeffloc, hm?
<1> for eg, i was analyzing various dhcp daemons a few weeks ago.. they use udp.. but they prefer using raw sockets.
<6> daxxar: this is done by binding
<4> AaronWL, my options seem to be: bind each interfaces individually, bind to a specific interface only (and send throught that) or use setsockopt w/ IP_PKTINFO to get it via recvmsg()
<3> AaronWL, aren't they going to do away with raw sockets soon
<4> Aeon_, yeah, if you know what IP the packet arrived on. :-)
<3> daxxar, it will use the right interface
<6> why you don't know ?
<4> jeffloc, it doesn't.
<1> jeffloc, well, dhcpd uses raw sockets, or bpf if on bsd, or packet interface if on linux, etc
<1> almost all systems actually have something better than raw sockets
<4> Heh, this question seems to be haunted by misunderstandings. I've gotten numerous "You just do <insert erroneus solution>"
<4> (because people do not understand what I want)
<3> if you have a local net : 192.168.1.* on eth1 and the internet on eth0 then anything going to a local address will go out eth1
<1> binding to each interface is painful, because you need to actually find all of the interfaces.
<4> jeffloc, multiple IPs on the same subnet.
<1> well, you don't actually bind to interfaces, but addresses.
<3> aliases?
<4> AaronWL, yeah, exactly. I don't want to do that.
<1> there is no portable way to find all addresses availible.
<4> jeffloc, yup.
<6> daxxar: doesn't recvfrom() give you source IP ?
<1> daxxar, if IP_PKTINFO is portable, id use that.
<3> why did you do that?
<4> Aeon_, source yes, but not destination.
<4> So either I use IP_PKTINFO or I use "bind single IP".
<1> or use config file
<4> AaronWL, AFAIK, it isn't. :|
<1> and make the sysadmin tell you each ip
<6> daxxar: but if you bind separate socket for each IP, and
<1> however, there is some virtue to avoiding config files.
<6> you receive on each, then you know
<6> destination IP
<6> by knowing at which socket the datagaram arrived, no ?
<4> Aeon_, yes, but I want to avoid that. It's a bit of a h***le, we use INADDR_ANY.
<1> Aeon_, right, but you need a way of enumerating each ip addr.
<4> And what AaronWL said. :)
<6> not a problem
<3> Aeon_, that's basicly my argument
<6> there are ioctls for that
<1> ioctls which are almost certainly centric to, say, linux
<6> daxxar: you can sort of use libpacap
<6> AaronWL: not really



<1> multiple ips per interface is definitely not going to port sensibly
<1> enumerating interfaces would be easier
<1> of course easily do-able, with some research, eg looking at libpcap src code :)
<6> well if you want udpo header then you want libpcap
<1> right, which is essentially doing raw sockets.
<1> and this is what most udp servers do, i think.
<1> painful though, because it requires root.
<6> you'll need the right filter
<6> libpcap is easy
<4> Hm, anyone used recvmsg() and IP_PKTINFO?
<1> does IP_PKTINFO require root? :P
<4> Nope
<1> see http://lists.ntp.isc.org/pipermail/bugs/2004-June/001281.html for a brief discussion of ntpd with the same problem
<4> http://www.rafb.net/paste/results/d6mQRb26.html
<1> INADDR_ANY vs bind to each
<1> going to krystal burger drive-thru. any hot female haqr grrls want to meet me there?
<4> That rafb paste, the output is:
<4> Connection to [8.0.0.0]
<4> :|
<0> is it possible to send spoofed packet with actual data similiar to a spoofed syn?
<7> kthx^, Q: "Is it possible to _________?" A: Yes.
<6> kthx^:: yees but that's illegal
<0> could you tell me how to do it Aeon_
<6> of course no
<0> how did you learn
<6> do i look like a person who advises how to do illegal things ?
<6> i'm law-obiding citizen
<0> why is it even illegal
<0> lmao
<3> +if you use raw packets you can do anything
<8> 4~/win 10
<0> yeah i dont know how to contrust them
<8> oops
<3> google
<0> ...
<1> calc buffer
<9> a region between two devices designed to distort or, if possible, prevent the flow of data in either direction.
<6> daxxar: at the very least, don't you need to check msg_cotroll ?
<3> that's a weird one
<6> *msg_controllen
<0> anyone heard of a circular buffer before?
<6> after recv
<6> from you ?
<4> Aeon_, hm, yeah. ;-)
<4> Aeon_, seems to be 24
<4> While sizeof(in_pktinfo) is 12.
<4> :o
<6> av at to ik o
<6> omg
<6> Oo
<10> daxxar: you can try to print it in hex and
<10> :_) guess what's inside
<10> maybe in_pktinfo is at some offset
<10> in fact,
<10> i think
<10> it's series of structs one after other
<10> with some type before each one
<10> i think you normally write a loop
<10> and find specific struct by its type
<10> lemme find an example
<4> Oh, you're right.
<4> http://www.opengroup.org/onlinepubs/000095399/basedefs/sys/socket.h.html
<4> CMSG_NXTHDR(mhdr,cmsg)
<4> If the first argument is a pointer to a msghdr structure and the second argument is a pointer to a cmsghdr structure in the ancillary data pointed to by the msg_control field of that msghdr structure, this macro shall return a pointer to the next cmsghdr structure, or a null
<10> wait wait i found it
<10> moment
<10> you must use some macros
<10> http://www.gnome.org/~markmc/code/test-descriptor-p***ing.c
<10> especially use of macros CMSG_FIRSTHDR
<10> no, that's not good example
<10> oh yes, it is
<10> pay attention to CMSG_NXTHDR
<11> Anyone have suggestions of a decent c/c++-kopiler for win32? I just need the compiler, no ide... I've tried vc++, but that's just too advanced..
<4> Did you try the compiler from the VCToolkit?


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c
or
Go to some related logs:

NEAX collectors
#goal
Soepeana + Document
recogintion letter
#solaris
#debian
#freebsd
wattage per outlet
#worldcup
#bsd



Home  |  disclaimer  |  contact  |  submit quotes