From owner-freebsd-questions@FreeBSD.ORG Fri Oct 6 11:26:01 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 80AB116A407 for ; Fri, 6 Oct 2006 11:26:01 +0000 (UTC) (envelope-from martin@dc.cis.okstate.edu) Received: from dc.cis.okstate.edu (dc.cis.okstate.edu [139.78.100.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id DEA7043D4C for ; Fri, 6 Oct 2006 11:26:00 +0000 (GMT) (envelope-from martin@dc.cis.okstate.edu) Received: from dc.cis.okstate.edu (localhost.okstate.edu [127.0.0.1]) by dc.cis.okstate.edu (8.13.3/8.13.3) with ESMTP id k96BQ0KO004716 for ; Fri, 6 Oct 2006 06:26:00 -0500 (CDT) (envelope-from martin@dc.cis.okstate.edu) Message-Id: <200610061126.k96BQ0KO004716@dc.cis.okstate.edu> To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4714.1160133960.1@dc.cis.okstate.edu> Date: Fri, 06 Oct 2006 06:26:00 -0500 From: Martin McCormick Subject: A Question of How to Handle Numerical Notation X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2006 11:26:01 -0000 I am writing a program on a UNIX system to munch the text output of a Cisco VOIP call manager and turn those data in to something that looks like the output of our hard-wired PBX. Fortunately, the data we need are a subset of all the data available so the main problem is simply that of reformatting most of the information. There is, however, one nasty little problem I have discovered. Both the UNIX and Cisco platforms handle time and date functions using unsigned 32-bit integers. No problem there. The times are based upon the number of seconds since the epoch of January 1, 1970 in GMT or UTC. That's great. I discovered soon, however, that there is an extra wrinkle that really messes things up quite a bit. The Cisco call manager outputs the hexadecimal form of 3 values in something that initially looks like good old hex but is good old hex being used to convey some form of notation, probably like scientific notation, that one must decode in order to get the actual hex values needed to recover the data. All we know for sure is that this has something to do with SQL and Microsoft. After all, everybody uses Microsoft and UNIX doesn't even exist, right? Does anybody know what this notation is called? Does an explanation of the algorithm exist in public so one can convert the strings that are part of the call manager output in to the unsigned ints that actually carry the right values? An example of the string in question looks like: "370A65FA-6965-4E40-A0DA-EC88DE6B" I appreciate any constructive suggestions, anything from what this notation is called to a description of how to process the 5 values. That would make writing C code possible to convert them in to the actual binary string that contains the data we need. Are there any FreeBSD libraries we can use to help the process along? I am sure this notation has a name, but not knowing it, makes searching for information about it rather difficult. Many thanks. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group