*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
wtap_dumper *dump;
struct wtap_pkthdr pkthdr;
- union wtap_pseudo_header ps_header;
+ union wtap_pseudo_header *ps_header = &pkthdr.pseudo_header;
int i, j, len_this_pkt, len_random, err;
guint8 buffer[65536];
#ifdef _WIN32
arg_list_utf_16to8(argc, argv);
+ create_app_running_mutex();
#endif /* _WIN32 */
while ((opt = getopt(argc, argv, "b:c:ht:")) != -1) {
}
memset(&pkthdr, 0, sizeof(pkthdr));
- memset(&ps_header, 0, sizeof(ps_header));
memset(buffer, 0, sizeof(buffer));
pkthdr.pkt_encap = example->sample_wtap_encap;
/* Load the sample pseudoheader into our pseudoheader buffer */
if (example->pseudo_buffer)
- memcpy(&ps_header, example->pseudo_buffer, example->pseudo_length);
+ memcpy(ps_header, example->pseudo_buffer, example->pseudo_length);
/* Load the sample into our buffer */
if (example->sample_buffer)
pkthdr.len = len_this_pkt;
pkthdr.ts.secs = i; /* just for variety */
- for (j = example->pseudo_length; j < (int) sizeof(ps_header); j++) {
- ((guint8*)&ps_header)[j] = (rand() % 0x100);
+ for (j = example->pseudo_length; j < (int) sizeof(*ps_header); j++) {
+ ((guint8*)ps_header)[j] = (rand() % 0x100);
}
for (j = example->sample_length; j < len_this_pkt; j++) {
}
}
- wtap_dump(dump, &pkthdr, &ps_header, &buffer[0], &err);
+ wtap_dump(dump, &pkthdr, &buffer[0], &err);
}
wtap_dump_close(dump, &err);
printf("Types:\n");
for (i = 0; i < num_entries; i++) {
- printf("\t%s\t%s\n", examples[i].abbrev, examples[i].longname);
+ printf("\t%-16s%s\n", examples[i].abbrev, examples[i].longname);
}
printf("\n");