home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / ada / 3845 < prev    next >
Encoding:
Text File  |  1992-12-30  |  1.7 KB  |  54 lines

  1. Newsgroups: comp.lang.ada
  2. Path: sparky!uunet!spool.mu.edu!agate!dog.ee.lbl.gov!news!manta!psm
  3. From: psm@nosc.mil (Scot Mcintosh)
  4. Subject: Can this data be represented in Ada?
  5. Message-ID: <1992Dec31.014719.22174@nosc.mil>
  6. Organization: Naval Ocean Systems Center, San Diego
  7. Date: Thu, 31 Dec 1992 01:47:19 GMT
  8. Lines: 44
  9.  
  10. I'm implementing a data communications protocol that has some data
  11. structural features that don't look possible to implement in Ada.
  12. Perhaps someone more experienced can suggest a way to accomplish
  13. what I'm trying to do (changing the protocol is not an option).
  14.  
  15. A Transmission Unit looks like:
  16.  
  17. +---------+----------+-----------+------+
  18. | Packet  |  Packet1 |  Packet2  | etc  |
  19. | Length  |          |           |  ... |
  20. +---------+----------+-----------+------+
  21.     |     |<-------->|<--------->|
  22.     |          ^          ^
  23.     |          |          |
  24.     |__________|__________+
  25.  
  26.  
  27. Each Packet looks like:
  28.  
  29. +---------+----------+--------------+
  30. | Data    |  Data    |  Padding     | 
  31. | Length  |          |(i.e. nothing)| 
  32. +---------+----------+--------------+
  33. |   |     |<-------->               |
  34. |   |          ^                    |
  35. |   |          |                    |
  36. |   |__________|                    |
  37. |                                   |
  38. |<--------------------------------->|
  39.         Packet Length
  40.  
  41. For a given transmission, the Packet Length is fixed, but can be
  42. different in the next transmission. The Data Length within each
  43. Packet can be different for each Packet. I've tried to figure out how
  44. to define Ada types for the Transmission Unit and Packet that
  45. allow for the variability of the field sizes and haven't succeeded.
  46. Any ideas? Thanks in advance.
  47.  
  48.  
  49. -- 
  50. ----
  51. Scot McIntosh
  52. Internet: psm%helios.nosc.mil@nosc.mil
  53. UUCP:     I have no idea
  54.