Sponsored Content
Top Forums Programming regarding extracting of packet and checking its crc Post 302148010 by porter on Thursday 29th of November 2007 11:52:07 AM
Old 11-29-2007
Quote:
Originally Posted by madfox
now how to add crc which is hexadecimal with the string.
What format is the data in? What protocol do you use to exchange the data? You need to be much more specific.

So far all I can say from what you say is

memcpy(p+1+strlen(p),crc,sizeof(crc));

which I am sure is not what you are intending....
 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

crc error ? ? ? ? H E L P

there is a message crc error when i install rethat 7.1 what is these message means ? And why is my harddisk drive detected as hdc not hda ?? please do reply if you have any idea or guesses . thanking you all systen config : intel P4 intel 845 256 SD ... (1 Reply)
Discussion started by: immanuelgangte
1 Replies

2. IP Networking

Seeing IP packet

Hi, Is there any way that i can directly take out the IP packet and see its contents. Waiting for your answer .............. Bye (4 Replies)
Discussion started by: manjunath
4 Replies

3. UNIX for Advanced & Expert Users

Does tar do crc checking on a tape or tar file?

Trying to answer a question about whether tar table-of-contents is a good tool for verifying tape data. (1 Reply)
Discussion started by: tjlst15
1 Replies

4. Solaris

invalid compressed data--crc error

I am getting this error when trying to unzip a file.gz . Anyone know how to resolve this ? (3 Replies)
Discussion started by: jxh461
3 Replies

5. Programming

CRC Code

Hi, We have packet of size 144 bytes and wants to genrate & check CRC . Can u give the CRC code ? (3 Replies)
Discussion started by: namrata5
3 Replies

6. Solaris

Can't PowerOn M3000 - Bad Data CRC

Hi, I was working on the M3000 and I did a init 0, powered off the system during the weekend. When I tried to poweron today, the XSCF linux boot image keeps on rebooting and does not go to the login for XSCF access. The "Check" LED is on amber. Tried diagnosing but cant get the system up. Any help... (1 Reply)
Discussion started by: incredible
1 Replies

7. Programming

64-bit CRC Transition To Bytewise Lookup-Table

Good Evening, I started working on the 17x17 4-colouring challenge, and I ran into a bit of an I/O snag. It was an enormous headache to detect the differences in very similar 289-char strings. Eventually, it made more sense to associate a CRC-Digest with each colouring. After learning... (0 Replies)
Discussion started by: HeavyJ
0 Replies

8. SCO

Stop boot system at "Checking protected password and checking subsystem databases"

Hi, (i'm sorry for my english) I'm a problem on boot sco unix 5.0.5 open server. this stop at "Checking protected password and checking subsystem databases" (See this image ) I'm try this: 1) http://www.digipedia.pl/usenet/thread/50/37093/#post37094 2) SCO: SCO Unix - Server hangs... (9 Replies)
Discussion started by: buji
9 Replies

9. AIX

Packet loss coming with big packet size ping

(5 Replies)
Discussion started by: Vishal_dba
5 Replies

10. Shell Programming and Scripting

How to get CRC check sum of files in java EAR file without extracting .jar/.war files to disk.?

unzip -v gives CRC info of each file in a zip(in my case .EAR) file. # unzip -v my-application.ear Archive: my-application.ear Length Method Size Cmpr Date Time CRC-32 Name -------- ------ ------- ---- ---------- ----- -------- ---- 197981 Defl:N 183708 7%... (1 Reply)
Discussion started by: kchinnam
1 Replies
crc16(n)						     Cyclic Redundancy Checks							  crc16(n)

__________________________________________________________________________________________________________________________________________________

NAME
crc16 - Perform a 16bit Cyclic Redundancy Check SYNOPSIS
package require Tcl 8.2 package require crc16 ?1.1.1? ::crc::crc16 ?-format format? ?-seed value? ?-implementation procname? message ::crc::crc16 ?-format format? ?-seed value? ?-implementation procname? -filename file ::crc::crc-ccitt ?-format format? ?-seed value? ?-implementation procname? message ::crc::crc-ccitt ?-format format? ?-seed value? ?-implementation procname? -filename file ::crc::xmodem ?-format format? ?-seed value? ?-implementation procname? message ::crc::xmodem ?-format format? ?-seed value? ?-implementation procname? -filename file _________________________________________________________________ DESCRIPTION
This package provides a Tcl-only implementation of the CRC algorithms based upon information provided at http://www.microconsul- tants.com/tips/crc/crc.txt There are a number of permutations available for calculating CRC checksums and this package can handle all of them. Defaults are set up for the most common cases. COMMANDS
::crc::crc16 ?-format format? ?-seed value? ?-implementation procname? message ::crc::crc16 ?-format format? ?-seed value? ?-implementation procname? -filename file ::crc::crc-ccitt ?-format format? ?-seed value? ?-implementation procname? message ::crc::crc-ccitt ?-format format? ?-seed value? ?-implementation procname? -filename file ::crc::xmodem ?-format format? ?-seed value? ?-implementation procname? message ::crc::xmodem ?-format format? ?-seed value? ?-implementation procname? -filename file The command takes either string data or a file name and returns a checksum value calculated using the CRC algorithm. The command used sets up the CRC polynomial, initial value and bit ordering for the desired standard checksum calculation. The result is format- ted using the format(n) specifier provided or as an unsigned integer (%u) by default. A number of common polynomials are in use with the CRC algorithm and the most commonly used of these are included in this package. For convenience each of these has a command alias in the crc namespace. It is possible to implement the CRC-32 checksum using this crc16 package as the implementation is sufficiently generic to extend to 32 bit checksums. As an example this has been done already - however this is not the fastest method to implement this algorithm in Tcl and a separate crc32 package is available. OPTIONS
-filename name Return a checksum for the file contents instead of for parameter data. -format string Return the checksum using an alternative format template. -seed value Select an alternative seed value for the CRC calculation. The default is 0 for the CRC16 calculation and 0xFFFF for the CCITT ver- sion. This can be useful for calculating the CRC for data structures without first converting the whole structure into a string. The CRC of the previous member can be used as the seed for calculating the CRC of the next member. It is also used for accumulating a checksum from fragments of a large message (or file) -implementation procname This hook is provided to allow users to provide their own implementation (perhaps a C compiled extension). The procedure specfied is called with two parameters. The first is the data to be checksummed and the second is the seed value. An integer is expected as the result. The package provides some implementations of standard CRC polynomials for the XMODEM, CCITT and the usual CRC-16 checksum. For con- venience, additional commands have been provided that make use of these implementations. EXAMPLES
% crc::crc16 "Hello, World!" 64077 % crc::crc-ccitt "Hello, World!" 26586 % crc::crc16 -format 0x%X "Hello, World!" 0xFA4D % crc::crc16 -file crc16.tcl 51675 AUTHORS
Pat Thoyts BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category crc of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. SEE ALSO
cksum(n), crc32(n), sum(n) KEYWORDS
checksum, cksum, crc, crc16, crc32, cyclic redundancy check, data integrity, security COPYRIGHT
Copyright (c) 2002, Pat Thoyts crc 1.1.1 crc16(n)
All times are GMT -4. The time now is 07:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy