Results 1 to 3 of 3
i want to zero pad some data to be sent. i want the zeros to be put in the end. for example that i want to zero pad the icmp ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-27-2009 #1Just Joined!
- Join Date
- Jun 2009
- Posts
- 11
zero padding
i want to zero pad some data to be sent. i want the zeros to be put in the end. for example that i want to zero pad the icmp data to be a total of 60 bytes. does anyone know how to do that?
- 06-27-2009 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,152
All you need is the address of the icmp data element in the structure that you are going to send.Code:memset((void*)icmpdata, 0, 60);
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 06-28-2009 #3Just Joined!
- Join Date
- Jun 2009
- Posts
- 11
memset() function fills the first n bytes of the memory area pointed to be s with the constant byte c. so the memset does the 123 to 0000000000123 or to 1230000000000. i want to do the second one


Reply With Quote
