Re: Sending using pfring_send()
Alfredo Cardigliano <[email protected]> Mon, 8 Jul 2019 19:05:10 +0200
| Newsgroups | gmane.linux.ntop.devel |
|---|---|
| Message-ID | <[email protected]> |
--===============6751017143069691019== Content-Type: multipart/alternative; boundary="Apple-Mail=_143646F7-23A2-422E-9316-F11DFCACCA0F" --Apple-Mail=_143646F7-23A2-422E-9316-F11DFCACCA0F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi Eitan please note that you are opening 2 interfaces with pfring_open, it seems that pfring_send() should send traffic to a single interface, what is the expected behaviour in your application? Alfredo > On 8 Jul 2019, at 17:58, Eitan Michaelson <[email protected]> wrote: >=20 > Hi, >=20 > I Just did .. >=20 > pfring_open("eth0, eth1"...)..OK > pfring_set_direction(rx_and_tx_direction) .. OK (not sure if I = actually needs this one) > pfring_set_socket_mode(send_and_recv_mode) ..OK=20 > pfring_enable_ring() .. OK > pfring_recv(blocking) .. I'm getting packets from the interfaces >=20 > However, > When I try to send data using pfring_send() I'm getting -1. > Note that my little test is actually sending the same packet that was = received from pfring_recv() > Not very smart but its just a test :) > Kernel module parameters : min_num_slots=3D65536 enable_tx_capture=3D0 > What did I do wrong ? >=20 > And if it was sending successfully, through which interface would it = be sending from? > Since I was open multiple interfaces using pfring_open() >=20 > 10x > Eitan. >=20 >=20 >=20 >=20 > _______________________________________________ > Ntop-dev mailing list > [email protected] <mailto:[email protected]> > http://listgateway.unipi.it/mailman/listinfo/ntop-dev = <http://listgateway.unipi.it/mailman/listinfo/ntop-dev> --Apple-Mail=_143646F7-23A2-422E-9316-F11DFCACCA0F Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D"">Hi = Eitan<div class=3D"">please note that you are opening 2 interfaces with = pfring_open,</div><div class=3D"">it seems that pfring_send() should = send traffic to a single interface,</div><div class=3D"">what is the = expected behaviour in your application?</div><div class=3D""><br = class=3D""></div><div class=3D"">Alfredo<br class=3D""><div><br = class=3D""><blockquote type=3D"cite" class=3D""><div class=3D"">On 8 Jul = 2019, at 17:58, Eitan Michaelson <<a href=3D"mailto:[email protected]" = class=3D"">[email protected]</a>> wrote:</div><br = class=3D"Apple-interchange-newline"><div class=3D""><div = style=3D"margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); = font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = background-color: rgb(255, 255, 255); text-decoration: none;" = class=3D"">Hi,</div><div style=3D"margin-bottom: 0cm; margin-top: 0pt; = caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; = font-style: normal; font-variant-caps: normal; font-weight: normal; = letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); = text-decoration: none;" class=3D""><br class=3D""></div><div = style=3D"margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); = font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = background-color: rgb(255, 255, 255); text-decoration: none;" class=3D"">I= Just did ..</div><div style=3D"margin-bottom: 0cm; margin-top: 0pt; = caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; = font-style: normal; font-variant-caps: normal; font-weight: normal; = letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); = text-decoration: none;" class=3D""><br class=3D""></div><div = style=3D"margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); = font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = background-color: rgb(255, 255, 255); text-decoration: none;" = class=3D"">pfring_open("<font color=3D"#ff0000" class=3D"">eth0, = eth1</font>"...)..OK</div><div style=3D"margin-bottom: 0cm; margin-top: = 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; = font-style: normal; font-variant-caps: normal; font-weight: normal; = letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); = text-decoration: none;" = class=3D"">pfring_set_direction(rx_and_tx_direction) .. OK (not sure if = I actually needs this one)<br = class=3D"">pfring_set_socket_mode(send_and_recv_mode) ..OK<span = class=3D"Apple-converted-space"> </span><br class=3D""></div><div = style=3D"margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); = font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = background-color: rgb(255, 255, 255); text-decoration: none;" = class=3D"">pfring_enable_ring() .. OK</div><div style=3D"margin-bottom: = 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; = font-size: 12px; font-style: normal; font-variant-caps: normal; = font-weight: normal; letter-spacing: normal; text-align: start; = text-indent: 0px; text-transform: none; white-space: normal; = word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: = rgb(255, 255, 255); text-decoration: none;" = class=3D"">pfring_recv(blocking) .. I'm getting packets from the = interfaces</div><div style=3D"margin-bottom: 0cm; margin-top: 0pt; = caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; = font-style: normal; font-variant-caps: normal; font-weight: normal; = letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); = text-decoration: none;" class=3D""><br class=3D""></div><div = style=3D"margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); = font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = background-color: rgb(255, 255, 255); text-decoration: none;" = class=3D"">However,<br class=3D""></div><div style=3D"margin-bottom: = 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; = font-size: 12px; font-style: normal; font-variant-caps: normal; = font-weight: normal; letter-spacing: normal; text-align: start; = text-indent: 0px; text-transform: none; white-space: normal; = word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: = rgb(255, 255, 255); text-decoration: none;" class=3D"">When I try to = send data using pfring_send() I'm getting -1.</div><div = style=3D"margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); = font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = background-color: rgb(255, 255, 255); text-decoration: none;" = class=3D"">Note that my little test is actually sending the same packet = that was received from pfring_recv()</div><div style=3D"margin-bottom: = 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; = font-size: 12px; font-style: normal; font-variant-caps: normal; = font-weight: normal; letter-spacing: normal; text-align: start; = text-indent: 0px; text-transform: none; white-space: normal; = word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: = rgb(255, 255, 255); text-decoration: none;" class=3D"">Not very smart = but its just a test :)</div><div style=3D"margin-bottom: 0cm; = margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; = font-size: 12px; font-style: normal; font-variant-caps: normal; = font-weight: normal; letter-spacing: normal; text-align: start; = text-indent: 0px; text-transform: none; white-space: normal; = word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: = rgb(255, 255, 255); text-decoration: none;" class=3D"">Kernel module = parameters : min_num_slots=3D65536 enable_tx_capture=3D0<br = class=3D""></div><div style=3D"margin-bottom: 0cm; margin-top: 0pt; = caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; = font-style: normal; font-variant-caps: normal; font-weight: normal; = letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); = text-decoration: none;" class=3D"">What did I do wrong ?</div><div = style=3D"margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); = font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = background-color: rgb(255, 255, 255); text-decoration: none;" = class=3D""><br class=3D""></div><div style=3D"margin-bottom: 0cm; = margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; = font-size: 12px; font-style: normal; font-variant-caps: normal; = font-weight: normal; letter-spacing: normal; text-align: start; = text-indent: 0px; text-transform: none; white-space: normal; = word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: = rgb(255, 255, 255); text-decoration: none;" class=3D"">And if it was = sending successfully, through which interface would it be sending = from?</div><div style=3D"margin-bottom: 0cm; margin-top: 0pt; = caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; = font-style: normal; font-variant-caps: normal; font-weight: normal; = letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); = text-decoration: none;" class=3D"">Since I was open multiple interfaces = using pfring_open()</div><div style=3D"margin-bottom: 0cm; margin-top: = 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; = font-style: normal; font-variant-caps: normal; font-weight: normal; = letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); = text-decoration: none;" class=3D""><br class=3D""></div><div = style=3D"margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); = font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = background-color: rgb(255, 255, 255); text-decoration: none;" = class=3D"">10x</div><div style=3D"margin-bottom: 0cm; margin-top: 0pt; = caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; = font-style: normal; font-variant-caps: normal; font-weight: normal; = letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); = text-decoration: none;" class=3D"">Eitan.</div><div = style=3D"margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); = font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = background-color: rgb(255, 255, 255); text-decoration: none;" = class=3D""><br class=3D""></div><p style=3D"margin-bottom: 0cm; = margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; = font-size: 12px; font-style: normal; font-variant-caps: normal; = font-weight: normal; letter-spacing: normal; text-align: start; = text-indent: 0px; text-transform: none; white-space: normal; = word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: = rgb(255, 255, 255); text-decoration: none;" class=3D""></p><div = style=3D"margin-bottom: 0cm; margin-top: 0pt; caret-color: rgb(0, 0, 0); = font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = background-color: rgb(255, 255, 255); text-decoration: none;" = class=3D""><br class=3D""></div><div style=3D"margin-bottom: 0cm; = margin-top: 0pt; caret-color: rgb(0, 0, 0); font-family: Helvetica; = font-size: 12px; font-style: normal; font-variant-caps: normal; = font-weight: normal; letter-spacing: normal; text-align: start; = text-indent: 0px; text-transform: none; white-space: normal; = word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: = rgb(255, 255, 255); text-decoration: none;" class=3D""><br = class=3D""></div><div style=3D"margin-bottom: 0cm; margin-top: 0pt; = caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; = font-style: normal; font-variant-caps: normal; font-weight: normal; = letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); = text-decoration: none;" class=3D""><br class=3D""></div><span = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: = normal; letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); = text-decoration: none; float: none; display: inline !important;" = class=3D"">_______________________________________________</span><br = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: = normal; letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); = text-decoration: none;" class=3D""><span style=3D"caret-color: rgb(0, 0, = 0); font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = background-color: rgb(255, 255, 255); text-decoration: none; float: = none; display: inline !important;" class=3D"">Ntop-dev mailing = list</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: = Helvetica; font-size: 12px; font-style: normal; font-variant-caps: = normal; font-weight: normal; letter-spacing: normal; text-align: start; = text-indent: 0px; text-transform: none; white-space: normal; = word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: = rgb(255, 255, 255); text-decoration: none;" class=3D""><a = href=3D"mailto:[email protected]" style=3D"font-family: = Helvetica; font-size: 12px; font-style: normal; font-variant-caps: = normal; font-weight: normal; letter-spacing: normal; orphans: auto; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; = -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" = class=3D"">[email protected]</a><br style=3D"caret-color: = rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: = normal; font-variant-caps: normal; font-weight: normal; letter-spacing: = normal; text-align: start; text-indent: 0px; text-transform: none; = white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; = background-color: rgb(255, 255, 255); text-decoration: none;" = class=3D""><a = href=3D"http://listgateway.unipi.it/mailman/listinfo/ntop-dev" = style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant-caps: normal; font-weight: normal; letter-spacing: normal; = orphans: auto; text-align: start; text-indent: 0px; text-transform: = none; white-space: normal; widows: auto; word-spacing: 0px; = -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; = background-color: rgb(255, 255, 255);" = class=3D"">http://listgateway.unipi.it/mailman/listinfo/ntop-dev</a></div>= </blockquote></div><br class=3D""></div></body></html>= --Apple-Mail=_143646F7-23A2-422E-9316-F11DFCACCA0F-- --===============6751017143069691019== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Ntop-dev mailing list [email protected] http://listgateway.unipi.it/mailman/listinfo/ntop-dev --===============6751017143069691019==--