All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] UDP packet sender
@ 2018-01-18 10:56 Gaëtan Carlier
  2018-01-22  9:33 ` Gaëtan Carlier
  2018-01-22 22:46 ` Joe Hershberger
  0 siblings, 2 replies; 9+ messages in thread
From: Gaëtan Carlier @ 2018-01-18 10:56 UTC (permalink / raw)
  To: u-boot

Hi,
I would like to implement a new command and submit it to the mailing list.
The command will have the following format:
udpsend <destination/broadcast ip> <destination port> <source port> <text to send>

udpsend 255.255.255.255 4040 0 hello world

If source port is 0, a random port will be used (11000 + (get_timer(0) % 4096))

Where do I have to place my code : cmd or net directory ?
For me cmd will be the better directory to keep it away from all more complex stuff like DHCP, TFTP, ...

Thank you for these informations.
Regards,
Gaëtan.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] UDP packet sender
  2018-01-18 10:56 [U-Boot] UDP packet sender Gaëtan Carlier
@ 2018-01-22  9:33 ` Gaëtan Carlier
  2018-01-22 21:28   ` Lukasz Majewski
  2018-01-22 22:46 ` Joe Hershberger
  1 sibling, 1 reply; 9+ messages in thread
From: Gaëtan Carlier @ 2018-01-22  9:33 UTC (permalink / raw)
  To: u-boot

Hi,
On 01/18/2018 11:56 AM, Gaëtan Carlier wrote:
> Hi,
> I would like to implement a new command and submit it to the mailing list.
> The command will have the following format:
> udpsend <destination/broadcast ip> <destination port> <source port> <text to send>
> 
> udpsend 255.255.255.255 4040 0 hello world
> 
> If source port is 0, a random port will be used (11000 + (get_timer(0) % 4096))
> 
> Where do I have to place my code : cmd or net directory ?
> For me cmd will be the better directory to keep it away from all more complex stuff like DHCP, TFTP, ...
> 
> Thank you for these informations.
> Regards,
> Gaëtan.
> 

Ping ?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] UDP packet sender
  2018-01-22  9:33 ` Gaëtan Carlier
@ 2018-01-22 21:28   ` Lukasz Majewski
  0 siblings, 0 replies; 9+ messages in thread
From: Lukasz Majewski @ 2018-01-22 21:28 UTC (permalink / raw)
  To: u-boot

Hi.

> Hi,
> On 01/18/2018 11:56 AM, Gaëtan Carlier wrote:
> > Hi,
> > I would like to implement a new command and submit it to the
> > mailing list. The command will have the following format:
> > udpsend <destination/broadcast ip> <destination port> <source port>
> > <text to send>
> > 
> > udpsend 255.255.255.255 4040 0 hello world
> > 
> > If source port is 0, a random port will be used (11000 +
> > (get_timer(0) % 4096))
> > 
> > Where do I have to place my code : cmd or net directory ?
> > For me cmd will be the better directory to keep it away from all
> > more complex stuff like DHCP, TFTP, ...
> > 
> > Thank you for these informations.
> > Regards,
> > Gaëtan.
> >   
> 
> Ping ?

You should write directly to network u-boot maintainer and add list to
CC.

Joe Hershberger <joe.hershberger@ni.com>

> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180122/e44f25e1/attachment.sig>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] UDP packet sender
  2018-01-18 10:56 [U-Boot] UDP packet sender Gaëtan Carlier
  2018-01-22  9:33 ` Gaëtan Carlier
@ 2018-01-22 22:46 ` Joe Hershberger
  2018-01-22 23:28   ` Gaëtan Carlier
  1 sibling, 1 reply; 9+ messages in thread
From: Joe Hershberger @ 2018-01-22 22:46 UTC (permalink / raw)
  To: u-boot

Hi Gaëtan,

On Thu, Jan 18, 2018 at 4:56 AM, Gaëtan Carlier <gcembed@gmail.com> wrote:
> Hi,
> I would like to implement a new command and submit it to the mailing list.
> The command will have the following format:
> udpsend <destination/broadcast ip> <destination port> <source port> <text to send>
>
> udpsend 255.255.255.255 4040 0 hello world
>
> If source port is 0, a random port will be used (11000 + (get_timer(0) % 4096))

I'd like to understand the purpose / use-case for this command? Maybe
there is a more appropriate way to solve the problem you have instead.

> Where do I have to place my code : cmd or net directory ?
> For me cmd will be the better directory to keep it away from all more complex stuff like DHCP, TFTP, ...

That's probably true. cmd/ would be the appropriate place.

-Joe

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] UDP packet sender
  2018-01-22 22:46 ` Joe Hershberger
@ 2018-01-22 23:28   ` Gaëtan Carlier
  2018-01-23  0:54     ` Joe Hershberger
  0 siblings, 1 reply; 9+ messages in thread
From: Gaëtan Carlier @ 2018-01-22 23:28 UTC (permalink / raw)
  To: u-boot

Hi Joe,

On 01/22/2018 11:46 PM, Joe Hershberger wrote:
> Hi Gaëtan,
> 
> On Thu, Jan 18, 2018 at 4:56 AM, Gaëtan Carlier <gcembed@gmail.com> wrote:
>> Hi,
>> I would like to implement a new command and submit it to the mailing list.
>> The command will have the following format:
>> udpsend <destination/broadcast ip> <destination port> <source port> <text to send>
>>
>> udpsend 255.255.255.255 4040 0 hello world
>>
>> If source port is 0, a random port will be used (11000 + (get_timer(0) % 4096))
> 
> I'd like to understand the purpose / use-case for this command? Maybe
> there is a more appropriate way to solve the problem you have instead.
> 

I want to send the current progression of an update script. As the board has no display/leds, the only way to get update progression is to broadcast UDP packet that a PC software will monitor. U-Boot will load/source a script from an ext4 partition. This script will load a rootfs image from update partition of an eMMC splitted into 10M chunks that will be written to an other partition of the eMMC.
This is for update on site (by customer).

This UDP command will also be used in a closed production LAN to send Unique ID of the CPU (secret) and the MAC address to the monitoring production (burning) software that will feed a database to be able to generate license keys linked to hardware and print a label with the product name and the MAC address.

Maybe there is already existing command that I can use from a U-Boot script ?

>> Where do I have to place my code : cmd or net directory ?
>> For me cmd will be the better directory to keep it away from all more complex stuff like DHCP, TFTP, ...
> 
> That's probably true. cmd/ would be the appropriate place.
> 
> -Joe
> 

Regards,
Gaëtan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] UDP packet sender
  2018-01-22 23:28   ` Gaëtan Carlier
@ 2018-01-23  0:54     ` Joe Hershberger
  2018-01-23 14:02       ` Gaëtan Carlier
  0 siblings, 1 reply; 9+ messages in thread
From: Joe Hershberger @ 2018-01-23  0:54 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 22, 2018 at 5:28 PM, Gaëtan Carlier <gcembed@gmail.com> wrote:
> Hi Joe,
>
> On 01/22/2018 11:46 PM, Joe Hershberger wrote:
>> Hi Gaëtan,
>>
>> On Thu, Jan 18, 2018 at 4:56 AM, Gaëtan Carlier <gcembed@gmail.com> wrote:
>>> Hi,
>>> I would like to implement a new command and submit it to the mailing list.
>>> The command will have the following format:
>>> udpsend <destination/broadcast ip> <destination port> <source port> <text to send>
>>>
>>> udpsend 255.255.255.255 4040 0 hello world
>>>
>>> If source port is 0, a random port will be used (11000 + (get_timer(0) % 4096))
>>
>> I'd like to understand the purpose / use-case for this command? Maybe
>> there is a more appropriate way to solve the problem you have instead.
>>
>
> I want to send the current progression of an update script. As the board has no display/leds, the only way to get update progression is to broadcast UDP packet that a PC software will monitor. U-Boot will load/source a script from an ext4 partition. This script will load a rootfs image from update partition of an eMMC splitted into 10M chunks that will be written to an other partition of the eMMC.
> This is for update on site (by customer).
>
> This UDP command will also be used in a closed production LAN to send Unique ID of the CPU (secret) and the MAC address to the monitoring production (burning) software that will feed a database to be able to generate license keys linked to hardware and print a label with the product name and the MAC address.
>
> Maybe there is already existing command that I can use from a U-Boot script ?

I think this is commonly done by enabling netconsole and controlling /
monitoring progress based on console output sent over UDP.

Cheers,
-Joe

>>> Where do I have to place my code : cmd or net directory ?
>>> For me cmd will be the better directory to keep it away from all more complex stuff like DHCP, TFTP, ...
>>
>> That's probably true. cmd/ would be the appropriate place.
>>
>> -Joe
>>
>
> Regards,
> Gaëtan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] UDP packet sender
  2018-01-23  0:54     ` Joe Hershberger
@ 2018-01-23 14:02       ` Gaëtan Carlier
  2018-02-02 19:13         ` Joe Hershberger
  0 siblings, 1 reply; 9+ messages in thread
From: Gaëtan Carlier @ 2018-01-23 14:02 UTC (permalink / raw)
  To: u-boot

Joe,
On 01/23/2018 01:54 AM, Joe Hershberger wrote:
> On Mon, Jan 22, 2018 at 5:28 PM, Gaëtan Carlier <gcembed@gmail.com> wrote:
>> Hi Joe,
>>
>> On 01/22/2018 11:46 PM, Joe Hershberger wrote:
>>> Hi Gaëtan,
>>>
>>> On Thu, Jan 18, 2018 at 4:56 AM, Gaëtan Carlier <gcembed@gmail.com> wrote:
>>>> Hi,
>>>> I would like to implement a new command and submit it to the mailing list.
>>>> The command will have the following format:
>>>> udpsend <destination/broadcast ip> <destination port> <source port> <text to send>
>>>>
>>>> udpsend 255.255.255.255 4040 0 hello world
>>>>
>>>> If source port is 0, a random port will be used (11000 + (get_timer(0) % 4096))
>>>
>>> I'd like to understand the purpose / use-case for this command? Maybe
>>> there is a more appropriate way to solve the problem you have instead.
>>>
>>
>> I want to send the current progression of an update script. As the board has no display/leds, the only way to get update progression is to broadcast UDP packet that a PC software will monitor. U-Boot will load/source a script from an ext4 partition. This script will load a rootfs image from update partition of an eMMC splitted into 10M chunks that will be written to an other partition of the eMMC.
>> This is for update on site (by customer).
>>
>> This UDP command will also be used in a closed production LAN to send Unique ID of the CPU (secret) and the MAC address to the monitoring production (burning) software that will feed a database to be able to generate license keys linked to hardware and print a label with the product name and the MAC address.
>>
>> Maybe there is already existing command that I can use from a U-Boot script ?
> 
> I think this is commonly done by enabling netconsole and controlling /
> monitoring progress based on console output sent over UDP.

a) I can/want not enable netconsole when the product is on the network of the customer.
b) Once on customer LAN, everything is DHCP.
c) I don't want to increase load of CPU because updating software on customer's computer has to decode all UDP frames sent by U-Boot while 10% of UDP are really needed (several boards can be on the same network).


> 
> Cheers,
> -Joe
> 
>>>> Where do I have to place my code : cmd or net directory ?
>>>> For me cmd will be the better directory to keep it away from all more complex stuff like DHCP, TFTP, ...
>>>
>>> That's probably true. cmd/ would be the appropriate place.
>>>
>>> -Joe
>>>
>>
>> Regards,
>> Gaëtan

Regards,
Gaëtan.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] UDP packet sender
  2018-01-23 14:02       ` Gaëtan Carlier
@ 2018-02-02 19:13         ` Joe Hershberger
  2018-02-06  7:57           ` Gaëtan Carlier
  0 siblings, 1 reply; 9+ messages in thread
From: Joe Hershberger @ 2018-02-02 19:13 UTC (permalink / raw)
  To: u-boot

On Tue, Jan 23, 2018 at 8:02 AM, Gaëtan Carlier <gcembed@gmail.com> wrote:
> Joe,
> On 01/23/2018 01:54 AM, Joe Hershberger wrote:
>> On Mon, Jan 22, 2018 at 5:28 PM, Gaëtan Carlier <gcembed@gmail.com> wrote:
>>> Hi Joe,
>>>
>>> On 01/22/2018 11:46 PM, Joe Hershberger wrote:
>>>> Hi Gaëtan,
>>>>
>>>> On Thu, Jan 18, 2018 at 4:56 AM, Gaëtan Carlier <gcembed@gmail.com> wrote:
>>>>> Hi,
>>>>> I would like to implement a new command and submit it to the mailing list.
>>>>> The command will have the following format:
>>>>> udpsend <destination/broadcast ip> <destination port> <source port> <text to send>
>>>>>
>>>>> udpsend 255.255.255.255 4040 0 hello world
>>>>>
>>>>> If source port is 0, a random port will be used (11000 + (get_timer(0) % 4096))

If you want to add this, add it as a command in  cmd/netcat.c and use
the same semantics as netcat as much as possible. Since there is no
pipe support in U-Boot's shell, the data to send will have to be a
parameter. Best to make it something that does not collide with
netcat.

In netcat, you specify a "-u" switch to enable UDP, so your command
would require that switch (so TCP could be added later).

So that means your invocation should be "nc -u -p <srcport> <host>
<dstport> -- Text to send"

>>>> I'd like to understand the purpose / use-case for this command? Maybe
>>>> there is a more appropriate way to solve the problem you have instead.
>>>>
>>>
>>> I want to send the current progression of an update script. As the board has no display/leds, the only way to get update progression is to broadcast UDP packet that a PC software will monitor. U-Boot will load/source a script from an ext4 partition. This script will load a rootfs image from update partition of an eMMC splitted into 10M chunks that will be written to an other partition of the eMMC.
>>> This is for update on site (by customer).
>>>
>>> This UDP command will also be used in a closed production LAN to send Unique ID of the CPU (secret) and the MAC address to the monitoring production (burning) software that will feed a database to be able to generate license keys linked to hardware and print a label with the product name and the MAC address.
>>>
>>> Maybe there is already existing command that I can use from a U-Boot script ?
>>
>> I think this is commonly done by enabling netconsole and controlling /
>> monitoring progress based on console output sent over UDP.
>
> a) I can/want not enable netconsole when the product is on the network of the customer.
> b) Once on customer LAN, everything is DHCP.
> c) I don't want to increase load of CPU because updating software on customer's computer has to decode all UDP frames sent by U-Boot while 10% of UDP are really needed (several boards can be on the same network).
>
>
>>
>> Cheers,
>> -Joe
>>
>>>>> Where do I have to place my code : cmd or net directory ?
>>>>> For me cmd will be the better directory to keep it away from all more complex stuff like DHCP, TFTP, ...
>>>>
>>>> That's probably true. cmd/ would be the appropriate place.
>>>>
>>>> -Joe
>>>>
>>>
>>> Regards,
>>> Gaëtan
>
> Regards,
> Gaëtan.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] UDP packet sender
  2018-02-02 19:13         ` Joe Hershberger
@ 2018-02-06  7:57           ` Gaëtan Carlier
  0 siblings, 0 replies; 9+ messages in thread
From: Gaëtan Carlier @ 2018-02-06  7:57 UTC (permalink / raw)
  To: u-boot

Hi Joe,

On 02/02/2018 08:13 PM, Joe Hershberger wrote:
> On Tue, Jan 23, 2018 at 8:02 AM, Gaëtan Carlier <gcembed@gmail.com> wrote:
>> Joe,
>> On 01/23/2018 01:54 AM, Joe Hershberger wrote:
>>> On Mon, Jan 22, 2018 at 5:28 PM, Gaëtan Carlier <gcembed@gmail.com> wrote:
>>>> Hi Joe,
>>>>
>>>> On 01/22/2018 11:46 PM, Joe Hershberger wrote:
>>>>> Hi Gaëtan,
>>>>>
>>>>> On Thu, Jan 18, 2018 at 4:56 AM, Gaëtan Carlier <gcembed@gmail.com> wrote:
>>>>>> Hi,
>>>>>> I would like to implement a new command and submit it to the mailing list.
>>>>>> The command will have the following format:
>>>>>> udpsend <destination/broadcast ip> <destination port> <source port> <text to send>
>>>>>>
>>>>>> udpsend 255.255.255.255 4040 0 hello world
>>>>>>
>>>>>> If source port is 0, a random port will be used (11000 + (get_timer(0) % 4096))
> 
> If you want to add this, add it as a command in  cmd/netcat.c and use
> the same semantics as netcat as much as possible. Since there is no
> pipe support in U-Boot's shell, the data to send will have to be a
> parameter. Best to make it something that does not collide with
> netcat.
> 
> In netcat, you specify a "-u" switch to enable UDP, so your command
> would require that switch (so TCP could be added later).
> 
> So that means your invocation should be "nc -u -p <srcport> <host>
> <dstport> -- Text to send"
>

Thank you for these informations. I will do that.
 
>>>>> I'd like to understand the purpose / use-case for this command? Maybe
>>>>> there is a more appropriate way to solve the problem you have instead.
>>>>>
>>>>
>>>> I want to send the current progression of an update script. As the board has no display/leds, the only way to get update progression is to broadcast UDP packet that a PC software will monitor. U-Boot will load/source a script from an ext4 partition. This script will load a rootfs image from update partition of an eMMC splitted into 10M chunks that will be written to an other partition of the eMMC.
>>>> This is for update on site (by customer).
>>>>
>>>> This UDP command will also be used in a closed production LAN to send Unique ID of the CPU (secret) and the MAC address to the monitoring production (burning) software that will feed a database to be able to generate license keys linked to hardware and print a label with the product name and the MAC address.
>>>>
>>>> Maybe there is already existing command that I can use from a U-Boot script ?
>>>
>>> I think this is commonly done by enabling netconsole and controlling /
>>> monitoring progress based on console output sent over UDP.
>>
>> a) I can/want not enable netconsole when the product is on the network of the customer.
>> b) Once on customer LAN, everything is DHCP.
>> c) I don't want to increase load of CPU because updating software on customer's computer has to decode all UDP frames sent by U-Boot while 10% of UDP are really needed (several boards can be on the same network).
>>
>>
>>>
>>> Cheers,
>>> -Joe
>>>
>>>>>> Where do I have to place my code : cmd or net directory ?
>>>>>> For me cmd will be the better directory to keep it away from all more complex stuff like DHCP, TFTP, ...
>>>>>
>>>>> That's probably true. cmd/ would be the appropriate place.
>>>>>
>>>>> -Joe
>>>>>
>>>>
>>>> Regards,
>>>> Gaëtan
>>
>> Regards,
>> Gaëtan.

Regards,
Gaëtan.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-02-06  7:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-18 10:56 [U-Boot] UDP packet sender Gaëtan Carlier
2018-01-22  9:33 ` Gaëtan Carlier
2018-01-22 21:28   ` Lukasz Majewski
2018-01-22 22:46 ` Joe Hershberger
2018-01-22 23:28   ` Gaëtan Carlier
2018-01-23  0:54     ` Joe Hershberger
2018-01-23 14:02       ` Gaëtan Carlier
2018-02-02 19:13         ` Joe Hershberger
2018-02-06  7:57           ` Gaëtan Carlier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.