From 01e08ae582b9e01bd5d236e748f43b4a2cedee43 Mon Sep 17 00:00:00 2001 From: Jakub Zawadzki Date: Tue, 3 Dec 2013 20:35:50 +0000 Subject: wiretap: start using svn path=/trunk/; revision=53764 --- wiretap/visual.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'wiretap/visual.c') diff --git a/wiretap/visual.c b/wiretap/visual.c index af47c9925b..8c70495f9c 100644 --- a/wiretap/visual.c +++ b/wiretap/visual.c @@ -209,7 +209,7 @@ int visual_open(wtap *wth, int *err, gchar **err_info) } /* Verify the file version is known */ - vfile_hdr.file_version = pletohs(&vfile_hdr.file_version); + vfile_hdr.file_version = pletoh16(&vfile_hdr.file_version); if (vfile_hdr.file_version != 1) { *err = WTAP_ERR_UNSUPPORTED; @@ -225,7 +225,7 @@ int visual_open(wtap *wth, int *err, gchar **err_info) the first packet is read. XXX - should we use WTAP_ENCAP_PER_PACKET for that? */ - switch (pletohs(&vfile_hdr.media_type)) + switch (pletoh16(&vfile_hdr.media_type)) { case 6: /* ethernet-csmacd */ encap = WTAP_ENCAP_ETHERNET; @@ -262,7 +262,7 @@ int visual_open(wtap *wth, int *err, gchar **err_info) /* Fill in the wiretap struct with data from the file header */ wth->file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_VISUAL_NETWORKS; wth->file_encap = encap; - wth->snapshot_length = pletohs(&vfile_hdr.max_length); + wth->snapshot_length = pletoh16(&vfile_hdr.max_length); /* Set up the pointers to the handlers for this file type */ wth->subtype_read = visual_read; @@ -272,8 +272,8 @@ int visual_open(wtap *wth, int *err, gchar **err_info) /* Add Visual-specific information to the wiretap struct for later use. */ visual = (struct visual_read_info *)g_malloc(sizeof(struct visual_read_info)); wth->priv = (void *)visual; - visual->num_pkts = pletohl(&vfile_hdr.num_pkts); - visual->start_time = ((double) pletohl(&vfile_hdr.start_time)) * 1000000; + visual->num_pkts = pletoh32(&vfile_hdr.num_pkts); + visual->start_time = ((double) pletoh32(&vfile_hdr.start_time)) * 1000000; visual->current_pkt = 1; return 1; @@ -352,21 +352,21 @@ visual_read_packet(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, } /* Get the included length of data. This includes extra headers + payload */ - packet_size = pletohs(&vpkt_hdr.incl_len); + packet_size = pletoh16(&vpkt_hdr.incl_len); phdr->presence_flags = WTAP_HAS_TS|WTAP_HAS_CAP_LEN; /* Set the packet time and length. */ t = visual->start_time; - t += ((double)pletohl(&vpkt_hdr.ts_delta))*1000; + t += ((double)pletoh32(&vpkt_hdr.ts_delta))*1000; secs = (time_t)(t/1000000); usecs = (guint32)(t - secs*1000000); phdr->ts.secs = secs; phdr->ts.nsecs = usecs * 1000; - phdr->len = pletohs(&vpkt_hdr.orig_len); + phdr->len = pletoh16(&vpkt_hdr.orig_len); - packet_status = pletohl(&vpkt_hdr.status); + packet_status = pletoh32(&vpkt_hdr.status); /* Do encapsulation-specific processing. @@ -511,7 +511,7 @@ visual_read_packet(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, case VN_AAL5: phdr->pseudo_header.atm.aal = AAL_5; phdr->pseudo_header.atm.type = TRAF_LLCMX; - phdr->pseudo_header.atm.aal5t_len = pntohl(&vatm_hdr.data_length); + phdr->pseudo_header.atm.aal5t_len = pntoh32(&vatm_hdr.data_length); break; case VN_OAM: @@ -527,9 +527,9 @@ visual_read_packet(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, phdr->pseudo_header.atm.aal = AAL_UNKNOWN; break; } - phdr->pseudo_header.atm.vpi = pntohs(&vatm_hdr.vpi) & 0x0FFF; - phdr->pseudo_header.atm.vci = pntohs(&vatm_hdr.vci); - phdr->pseudo_header.atm.cells = pntohs(&vatm_hdr.cell_count); + phdr->pseudo_header.atm.vpi = pntoh16(&vatm_hdr.vpi) & 0x0FFF; + phdr->pseudo_header.atm.vci = pntoh16(&vatm_hdr.vci); + phdr->pseudo_header.atm.cells = pntoh16(&vatm_hdr.cell_count); /* Using bit value of 1 (DCE -> DTE) to indicate From Network */ phdr->pseudo_header.atm.channel = vatm_hdr.info & FROM_NETWORK; -- cgit v1.2.1