osmocom
/
vovida-gsml
Archived
10
0
Fork 0

import source code of Vovida GSML project (from www.vovida.org)

This is the source code as it was published on vovida.org a couple
of years ago. The filename was gsml-1_0.tar.bz2
master gsml-1_0
Harald Welte 13 years ago
commit 903a15fc26
  1. 135
      LICENSE.txt
  2. 54
      Scrubbed_File_List.txt
  3. 47
      data/mnet/Common/Alarm/Makefile
  4. 151
      data/mnet/Common/Alarm/include/AlarmTask.h
  5. 168
      data/mnet/Common/Alarm/include/alarm.h
  6. 127
      data/mnet/Common/Alarm/include/alarm_interface.h
  7. 44
      data/mnet/Common/Alarm/src/Makefile
  8. 198
      data/mnet/Common/Alarm/src/alarm_diskFile.cpp
  9. 196
      data/mnet/Common/Alarm/src/alarm_event.cpp
  10. 187
      data/mnet/Common/Alarm/src/alarm_main.cpp
  11. 101
      data/mnet/Common/Alarm/src/alarm_message.cpp
  12. 441
      data/mnet/Common/Alarm/src/alarm_modules.cpp
  13. 445
      data/mnet/Common/Alarm/src/alarm_socket.cpp
  14. 173
      data/mnet/Common/Alarm/src/alarm_sysCmd.cpp
  15. 102
      data/mnet/Common/Java/AlarmApplet/Alarm.java
  16. 139
      data/mnet/Common/Java/AlarmApplet/AlarmStatusApplet.java
  17. 139
      data/mnet/Common/Java/AlarmApplet/AlarmStatusData.java
  18. 53
      data/mnet/Common/Java/AlarmApplet/AlarmStatusPanel.java
  19. 221
      data/mnet/Common/Java/AlarmApplet/AlarmStatusTable.java
  20. 34
      data/mnet/Common/Java/AlarmApplet/AlarmStatusTableModel.java
  21. 126
      data/mnet/Common/Java/AlarmApplet/AlarmStatusTablePopupMenu.java
  22. 469
      data/mnet/Common/Java/AlarmApplet/AlarmTCPThread.java
  23. 337
      data/mnet/Common/Java/AlarmApplet/FilterFrame.java
  24. 35
      data/mnet/Common/Java/AlarmApplet/FilterObject.java
  25. 41
      data/mnet/Common/Java/AlarmApplet/Makefile
  26. 40
      data/mnet/Common/Java/AlarmApplet/com/jetcell/MibWM/Makefile
  27. BIN
      data/mnet/Common/Java/Images/Jetcelllogo.jpg
  28. BIN
      data/mnet/Common/Java/Images/app_icon.GIF
  29. BIN
      data/mnet/Common/Java/Images/app_icon2.GIF
  30. BIN
      data/mnet/Common/Java/Images/cisco.JPG
  31. BIN
      data/mnet/Common/Java/Images/cisco2.JPG
  32. BIN
      data/mnet/Common/Java/Images/ciscologo.jpg
  33. BIN
      data/mnet/Common/Java/Images/clear.gif
  34. BIN
      data/mnet/Common/Java/Images/cowbell.wav
  35. BIN
      data/mnet/Common/Java/Images/critical.gif
  36. BIN
      data/mnet/Common/Java/Images/filler.gif
  37. BIN
      data/mnet/Common/Java/Images/gmc.jpg
  38. BIN
      data/mnet/Common/Java/Images/grey.gif
  39. BIN
      data/mnet/Common/Java/Images/indeterminate.gif
  40. BIN
      data/mnet/Common/Java/Images/indeterminate2.gif
  41. BIN
      data/mnet/Common/Java/Images/information.gif
  42. BIN
      data/mnet/Common/Java/Images/line-01.gif
  43. BIN
      data/mnet/Common/Java/Images/line-02.gif
  44. BIN
      data/mnet/Common/Java/Images/logo.gif
  45. BIN
      data/mnet/Common/Java/Images/logo.jpg
  46. BIN
      data/mnet/Common/Java/Images/logo1.gif
  47. BIN
      data/mnet/Common/Java/Images/major.gif
  48. BIN
      data/mnet/Common/Java/Images/minor.gif
  49. BIN
      data/mnet/Common/Java/Images/minus.gif
  50. BIN
      data/mnet/Common/Java/Images/normal.gif
  51. BIN
      data/mnet/Common/Java/Images/notify.wav
  52. BIN
      data/mnet/Common/Java/Images/plus.gif
  53. BIN
      data/mnet/Common/Java/Images/scritical.gif
  54. BIN
      data/mnet/Common/Java/Images/sinformation.gif
  55. BIN
      data/mnet/Common/Java/Images/smajor.gif
  56. BIN
      data/mnet/Common/Java/Images/sminor.gif
  57. BIN
      data/mnet/Common/Java/Images/undrkunstrukson.gif
  58. BIN
      data/mnet/Common/Java/Images/vipercell.gif
  59. BIN
      data/mnet/Common/Java/Images/wireless.jpg
  60. BIN
      data/mnet/Common/Java/Images/wireless1.JPG
  61. 177
      data/mnet/Common/Java/Java/AlarmApplet.java
  62. 121
      data/mnet/Common/Java/Java/AlarmCommThread.java
  63. 53
      data/mnet/Common/Java/Java/ConfigApplet.java
  64. 70
      data/mnet/Common/Java/Java/ConfigAppletBeanInfo.java
  65. 69
      data/mnet/Common/Java/Java/Makefile
  66. 58
      data/mnet/Common/Java/Java/SubscriberApplet.java
  67. 69
      data/mnet/Common/Java/Java/SubscriberAppletBeanInfo.java
  68. 58
      data/mnet/Common/Java/Makefile
  69. 154
      data/mnet/Common/Java/Text/AlarmCode.English
  70. 216
      data/mnet/Common/Java/com/jetcell/MibWM/AlarmData.java
  71. 131
      data/mnet/Common/Java/com/jetcell/MibWM/AlarmMessageMap.java
  72. 467
      data/mnet/Common/Java/com/jetcell/MibWM/AlarmPanel.java
  73. 588
      data/mnet/Common/Java/com/jetcell/MibWM/AlarmTable.java
  74. 43
      data/mnet/Common/Java/com/jetcell/MibWM/AlarmTableModel.java
  75. 218
      data/mnet/Common/Java/com/jetcell/MibWM/AlarmTablePopupMenu.java
  76. 97
      data/mnet/Common/Java/com/jetcell/MibWM/AlarmTableSorter.java
  77. 312
      data/mnet/Common/Java/com/jetcell/MibWM/BaseTable.java
  78. 136
      data/mnet/Common/Java/com/jetcell/MibWM/ImageLoader.java
  79. 38
      data/mnet/Common/Java/com/jetcell/MibWM/Makefile
  80. 104
      data/mnet/Common/Java/com/jetcell/MibWM/TableMap.java
  81. 195
      data/mnet/Common/Java/com/jetcell/MibWM/TablePopupMenu.java
  82. 360
      data/mnet/Common/Java/com/jetcell/MibWM/TableSorter.java
  83. 80
      data/mnet/Common/Java/com/jetcell/MibWM/TextClipboard.java
  84. 280
      data/mnet/Common/Java/com/jetcell/MibWM/TextComponentPopupMenu.java
  85. 779
      data/mnet/Common/Java/com/jetcell/MibWM/Util.java
  86. 156
      data/mnet/Common/Java/com/jetcell/MibWM/WMTextField.java
  87. 60
      data/mnet/Common/Java/java.mk
  88. 28
      data/mnet/Common/Os/Makefile
  89. 40
      data/mnet/Common/Os/include/JCMsgQDefs.h
  90. 195
      data/mnet/Common/Os/loadmodule/LoadModule.cpp
  91. 62
      data/mnet/Common/Os/loadmodule/Makefile
  92. 91
      data/mnet/Common/Os/src/JCCTimer.cpp
  93. 470
      data/mnet/Common/Os/src/JCModule.cpp
  94. 197
      data/mnet/Common/Os/src/JCMsgQueue.cpp
  95. 43
      data/mnet/Common/Os/src/JCMutex.cpp
  96. 193
      data/mnet/Common/Os/src/JCTask.cpp
  97. 62
      data/mnet/Common/Os/src/Makefile
  98. 65
      data/mnet/Common/Os/test/Makefile
  99. 91
      data/mnet/Common/Os/test/MsgQTest.cpp
  100. 47
      data/mnet/Common/Pm/Makefile
  101. Some files were not shown because too many files have changed in this diff Show More

@ -0,0 +1,135 @@
Cisco-style Mozilla Public License 1.1
1. Definitions.
1.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party.
1.2. ''Contributor'' means each entity that creates or contributes to the creation of Modifications.
1.3. ''Contributor Version'' means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
1.4. ''Covered Code'' means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
1.5. ''Electronic Distribution Mechanism'' means a mechanism generally accepted in the software development community for the electronic transfer of data.
1.6. ''Executable'' means Covered Code in any form other than Source Code.
1.7. ''Initial Developer'' means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
1.8. ''Larger Work'' means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
1.9. ''License'' means this document.
1.9.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
1.9. ''Modifications'' means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
B. Any new file that contains any part of the Original Code or previous Modifications.
1.10. ''Original Code'' means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
1.11."Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
1.12. ''Source Code'' means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
1.13. "You'' (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You'' includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control'' means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
2. Source Code License.
2.1. The Initial Developer Grant. The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and
(b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof).
(c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License.
(d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices.
2.2. Contributor Grant. Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and
(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
(c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code.
(d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor.
3. Distribution Obligations.
3.1. Application of License. The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
3.2. Availability of Source Code. Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.
3.3. Description of Modifications. You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
3.4. Intellectual Property Matters
(a) Third Party Claims. If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL'' which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
(b) Contributor APIs. If Contributor's Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file.
(c) Representations. Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License.
3.5. Required Notices. You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
3 .6. Distribution of Executable Versions. You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
3.7. Larger Works.You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
4. Inability to Comply Due to Statute or Regulation. If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
5. Application of this License. This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code.
6. Versions of the License.
6.1. New Versions. Netscape Communications Corporation (''Netscape'') may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
6.2. Effect of New Versions. Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License.
6.3. Derivative Works. If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases ''Mozilla'', ''MOZILLAPL'', ''MOZPL'', ''Netscape'', "MPL", ''NPL'' “Cisco”, “Cisco Systems, Inc.” “Cisco Systems”, “Cisco MPL” or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Cisco-style MPL. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
7. DISCLAIMER OF WARRANTY. COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
8. TERMINATION.
8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
8.2. If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant") alleging that:
(a) such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above.
(b) any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant.
8.3. If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.
9. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
10. U.S. GOVERNMENT END USERS. The Covered Code is a ''commercial item,'' as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of ''commercial computer software'' and ''commercial computer software documentation,'' as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
11. MISCELLANEOUS. This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
12. RESPONSIBILITY FOR CLAIMS. As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
13. MULTIPLE-LICENSED CODE. Initial Developer may designate portions of the Covered Code as Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the NPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A.
----------
EXHIBIT A
Cisco-style Mozilla Public License.
``The contents of this file are subject to the Cisco-style Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at _vovida.org_
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
The Original Code is _all code in the zip file labelled _gsml-1_0.zip_.
The Initial Developer of the Original Code is __Cisco Systems, Inc___. Portions created by __Cisco Systems, Inc_ are Copyright (C) __2005_ __Cisco Systems, Inc_. All Rights Reserved.
Contributor(s): _Cisco Systems, Inc and James Forster___.

@ -0,0 +1,54 @@
The following files were 'scrubbed' from the archived Cisco codebase due to questions about re-distribution rights.
Common\apm\include\msgDefs.h:// (c) Copyright JetCell 2000
Common\apm\include\msgProc.h:// (c) Copyright JetCell 1998
Common\apm\src\debug.cpp:// (c) Copyright JetCell 1998
Common\bssgp\win32test\dbgout.cpp: * Copyright JetCell, Inc. 1999-2000 All rights reserved *
Common\bssgp\win32test\dbgout.h: * Copyright JetCell, Inc. 1999-2000 All rights reserved *
Common\cdr\include\FTClient.h:// (c) Copyright JetCell 2000
Common\cdr\src_server\FTClient.cpp:// (c) Copyright JetCell 2000
Common\Pm\src\socketutil.cpp:// (c) Copyright JetCell 1998
GP10\Dsp\Driver\Drv6x.c:/* (C) Copyright 1997,1998 by DNA Enterprises, Inc. */
GP10\Dsp\include\COMMON.H:/* (C) Copyright 1997,1998 by DNA Enterprises, Inc. */
GP10\Dsp\include\DMA_UTIL.H:/* (C) Copyright 1997,1998 by DNA Enterprises, Inc. */
GP10\Dsp\include\MCBSPDRV.H:/* (C) Copyright 1997,1998 by DNA Enterprises, Inc. */
GP10\Host\Alarm\Test\alarm_test.cpp:* (C) Copyright 1999 JetCell Inc., CA, USA http://www.jetcell.com/
GP10\Host\Cdc_bsp\ads860.h:/* Copyright 1984-1997 Wind River Systems, Inc. */
GP10\Host\Cdc_bsp\ataDrv.c:/* Copyright 1989-1998 Wind River Systems, Inc. */
GP10\Host\Cdc_bsp\cdcim.h:/* Copyright 1984-1997 Wind River Systems, Inc. */
GP10\Host\Cdc_bsp\config.h:/* Copyright 1984-1997 Wind River Systems, Inc. */
GP10\Host\Cdc_bsp\configdb.h: * Copyright 1984-1996 Wind River Systems, Inc.
GP10\Host\Cdc_bsp\configNet.h:/* Copyright 1984-1998 Wind River Systems, Inc. */
GP10\Host\Cdc_bsp\motfecend.c:/* Copyright 1989-1998 Wind River Systems, Inc. */
GP10\Host\Cdc_bsp\sysLib.c:/* Copyright 1984-1997 Wind River Systems, Inc. */
GP10\Host\Cdc_bsp\sysSerial.c:/* Copyright 1984-1996 Wind River Systems, Inc. */
GP10\Host\Common_To_Host\include\logmodules.h: * Copyright JetCell, Inc. 1999-2000 All rights reserved *
GP10\Host\Common_To_Host\Logging\VCLOGGING.H: * Copyright JetCell, Inc. All rights reserved *
GP10\Host\Common_To_Host\Logging\VcModules.h: * Copyright JetCell, Inc. 1999-2000 All rights reserved *
GP10\Host\Common_To_Host\TcpServer\TcpSrvApi.h:* (C) Copyright 1999 JetCell Inc., CA, USA http://www.jetcell.com/
GP10\Host\Http\include\enum_tab.h: * Copyright (C) 1998 Rapid Logic, Inc.
GP10\Host\Http\include\http_feedback.h:* (C) Copyright 1999 JetCell Inc., CA, USA http://www.jetcell.com/
GP10\Host\Http\include\options.h: * Copyright (C) 1998 Rapid Logic, Inc.
GP10\Host\Http\src\http_event.c:* (C) Copyright 1999 JetCell Inc., CA, USA http://www.jetcell.com/
GP10\Host\Http\src\http_feedback.c:* (C) Copyright 1999 JetCell Inc., CA, USA http://www.jetcell.com/
GP10\Host\Http\src\http_main.c:* (C) Copyright 1999 JetCell Inc., CA, USA http://www.jetcell.com/
GP10\Host\Http\src\http_oamOperation.c:* (C) Copyright 1999 JetCell Inc., CA, USA http://www.jetcell.com/
GP10\Host\Http\src\http_post.c:* (C) Copyright 1999 JetCell Inc., CA, USA http://www.jetcell.com/
GP10\Host\Http\src\http_security.c:* (C) Copyright 1999 JetCell Inc., CA, USA http://www.jetcell.com/
GP10\Host\Http\src\ignition.c: * Copyright (C) 1999 Rapid Logic, Inc.
GP10\Host\Http\src\main.c:* Copyright (C) 1998 Rapid Logic, Inc.
GP10\Host\l1proxy\include\cdcim.h:/* Copyright 1984-1997 Wind River Systems, Inc. */
GP10\Host\logging\src\l3MsLog.cpp:// (c) Copyright JetCell 1998
GP10\Host\TcpServer\Include\queue.h:* (C) Copyright 1999 JetCell Inc., CA, USA http://www.jetcell.com/
GP10\Host\TcpServer\Src\queue.cpp:* (C) Copyright 1999 JetCell Inc., CA, USA http://www.jetcell.com/
GP10\Host\TcpServer\Src\TcpServer.cpp:* (C) Copyright 1999 JetCell Inc., CA, USA http://www.jetcell.com/
GP10\Host\TimeSync\src\time_userTime.cpp:* (C) Copyright 1999 JetCell Inc., CA, USA http://www.jetcell.com/
GP10\Host\voip\include\gkadd.h:* Copyright RADVision 1998. *
GP10\Host\voip\include\gkcci.h:* Copyright RADVision 1998. *
GP10\Host\voip\include\gklrqi.h:* Copyright RADVision 1998. *
GP10\Host\voip\include\gkmain.h:* Copyright RADVision 1998. *
GP10\Host\voip\include\gkrgi.h:* Copyright RADVision 1998. *
GP10\Host\voip\include\gkstorage.h:* Copyright RADVision 1998. *
GP10\Host\voip\include\gkTypes.h:* Copyright RADVision 1998. *

@ -0,0 +1,47 @@
##########################################################
#
# (c) Copyright Cisco 2000
# All Rights Reserved
#
# Use Examples:
#
# Case 1:
# make all VOB=GP10 -
# Places .out in VOB/bin directory
#
# Case 2:
# make all VOB=GP10 APPDIR=Host\<Application Name>\<Source Directory> -
# Places .o file(s) in VOB\$(APPDIR)\bin directory.
#
# <Application Name> = Name of Application directory
# <Source Directory> = application sub directory where the calling
# Makefile resides.
#
# Example: make all VOB=GP10 APPDIR=Host\vxTemplate\src
#
# (OPTIONAL) Append REPLACE - Replaces the List of directories
# to be used in the SUBDIRS variable
#
# Example: make all VOB=GP10 APPDIR=Host\vxTemplate\src REPLACE=src
#
# Note: This make file must reference a VOB that
# has a defs.mk in the top level directory.
#
##########################################################
SUBDIRS = src
# TOP_OF_VOB must be defined before including l3defs.mk
TOP_OF_VOB = ..\..
VOBDIR = $(TOP_OF_VOB)/$(VOB)
# Allows a sub-set of the source code directories to be used
ifneq ($(REPLACE),)
SUBDIRS = $(REPLACE)
endif
include $(VOBDIR)/l3defs.mk

@ -0,0 +1,151 @@
/*********************************************************************/
/* */
/* (c) Copyright Cisco 2000 */
/* All Rights Reserved */
/* */
/*********************************************************************/
/*********************************************************************/
/* */
/* Version : 1.0 */
/* Status : Under development */
/* File : AlarmTask.h */
/* Author(s) : Bhawani Sapkota */
/* Create Date : 9/18/2000 */
/* Description : This file contains Alarm task routines */
/* */
/*********************************************************************/
/* REVISION HISTORY
/*___________________________________________________________________*/
/*----------+--------+-----------------------------------------------*/
/* Name | Date | Reason */
/*----------+--------+-----------------------------------------------*/
/* Bhawani |09/28/00| Initial Draft */
/*----------+--------+-----------------------------------------------*/
/*********************************************************************/
#ifndef _ALARMTASK_H_
#define _ALARMTASK_H_ /* include once only */
#include "Alarm.h"
/* Include product specific code here */
#if defined (MNET_PRODUCT_SPECIFIC_GS)
#include "GSOsTune.h"
#elif defined (MNET_PRODUCT_SPECIFIC_GMC)
#include "vclogging.h"
#elif defined (MNET_PRODUCT_SPECIFIC_GP10)
#include "Logging/vclogging.h"
#endif
typedef struct _AlarmEntry_t
{
AlarmCode_t code; // last error code
int id; // first alarm ID
Alarm_severity_t severity; // severity
ubyte4 utc; // outstanding since this time
int count;
struct _AlarmEntry_t *next;
}AlarmEntry_t;
class AlarmTask:public JCTask {
public:
AlarmTask(char *);
~AlarmTask();
int InitAlarmTask();
static int bootupTimeoutHandler();
static int entryPoint();
static int AlarmMain(void);
static char *srcName();
static AlarmTask *theAlarmTask;
// disk operation
STATUS saveAlarm(const char* msg);
STATUS renameOldLogFile();
STATUS getLastId(unsigned long *id);
int generateNextId();
AlarmEntry_t *findAlarmEntry(MNET_MODULE_ID mid, AlarmCode_t errorCode);
bool addAlarmEntry(MNET_MODULE_ID mid, MibTag moduleErrorTag, AlarmCode_t code, char *arg1=NULL, char *arg2=NULL);
bool delAlarmEntry(MNET_MODULE_ID mid, MibTag moduleErrorTag, AlarmCode_t code);
EnableDisableState_t updateOperationalState();
// module handling
AlarmCode_t getMdlStatus(MNET_MODULE_ID mid);
AlarmEntry_t *allocEntry(MNET_MODULE_ID id);
void printStatus();
void getOutstandingAlarmCount(ubyte1 &, ubyte1 &, ubyte1 &);
// message q operation
JC_STATUS msgqSend( unsigned int msgType, char * buffer, unsigned int nBytes);
JC_STATUS alarmSend(InterModuleAlarmMsgType_t mtype,
MNET_MODULE_ID mid,
MibTag moduleErrorTag=0,
AlarmCode_t alarm_code=EC_COMMON_NOERROR,
char *arg1=NULL,
char *arg2=NULL
);
//AMS Operation
bool sendSummaryUpdateToAms();
void reportNewAlarm(int id, MNET_MODULE_ID mid, AlarmCode_t ecode,
Alarm_severity_t severity, char * arg1=0, char * arg2=0);
//Operational State Management
EnableDisableState_t getOperationState();
void setOperationState(EnableDisableState_t opstate );
// Mib access control status
EnableDisableState_t getMibAcessControlState();
void setMibAcessControlState(EnableDisableState_t opstate);
void updateModuleLastError(MNET_MODULE_ID mid, MibTag moduleErrorTag);
void setModuleLastError(MibTag moduleErrorTag, AlarmCode_t alarm_code);
// startup and quit
void quit();
int startup();
void closeSocket();
private:
JCMsgQueue *jcMsgQ;
JCCTimer *initTimer;
char *_mnetbase; /* holds MNET_BASE environment variable */
char *_logfilename; /* holds absolute path of the logfilename */
char *_sourceName; /* holds the source name */
char *_sourceType; /* type of the source (Gp, Gmc, Itp, */
char *_msgRecvBuff; /* holds received message */
AlarmEntry_t *_ms[MNET_MAX_MODULE_IDS]; /* current module Alarm Status */
AlarmEntry_t *_ap; /* Alarm pools */
int _statistics[2][Alarm_max_severity];
void populateSourceName();
//status variables
bool _quit;
bool _mibAccessState;
static bool isOneCreated;
// Disallow the following functions
AlarmTask();
AlarmTask(const AlarmTask&);
AlarmTask& operator=(const AlarmTask&);
int operator== (const AlarmTask&) const;
};
#endif

@ -0,0 +1,168 @@
/*********************************************************************/
/* */
/* (c) Copyright Cisco 2000 */
/* All Rights Reserved */
/* */
/*********************************************************************/
/*********************************************************************/
/* */
/* Version : 1.0 */
/* Status : Under development */
/* File : AlarmTask.h */
/* Author(s) : Bhawani Sapkota */
/* Create Date : 9/18/2000 */
/* Description : This file contains alarm task basic defination */
/* routines */
/* */
/*********************************************************************/
/* REVISION HISTORY
/*___________________________________________________________________*/
/*----------+--------+-----------------------------------------------*/
/* Name | Date | Reason */
/*----------+--------+-----------------------------------------------*/
/* Bhawani |07/14/00| Initial Draft */
/* Bhawani |11/20/00| resturctured to share among GP, GMS and GS */
/*----------+--------+-----------------------------------------------*/
/*********************************************************************/
#if !defined(_ALARM_H_)
#define _ALARM_H_
#include "AlarmCode.h"
#include "Os/JCMsgQueue.h"
#include "Os/JCModule.h"
#include "Os/JCCTimer.h"
#include "Os/JCTask.h"
#include "alarm_prodSpec.h"
typedef unsigned short ubyte2;
typedef unsigned long ubyte4;
typedef unsigned char ubyte1;
typedef short sbyte2;
typedef long sbyte4;
#define ALARM_q_maxMsgs 32
#define ALARM_q_maxMsgLength 100
#define ALARM_q_option MSG_Q_PRIORITY
#define ALARM_q_timeout 18000 /* 5 minutes */
#define ALARM_task_name "tAlarm"
#define ALARM_mib_lock_timeout 7200 /* 2 minutes */
#define ALARM_record_length 70
#define ALARM_max_records 58
#define ALARM_max_outstanding 50
/* It is assumeed that current working directory is ViperCall */
#define ALARM_logFile "/Alarm/alarm.log"
#define ALARM_logFileMaxSize 128
#define ALARM_dirChar '/'
#define ALARM_maxMsgSize 1024
#define ALARM_defaultRecvBuffer 128
#define ALARM_optionalArgSize 40
#define ALARM_monStation "QSEvent"
#define ALARM_mchResponse "mchResponse"
typedef enum Alarm_severity
{
Alarm_critical=0,
Alarm_major,
Alarm_minor,
Alarm_info,
Alarm_max_severity
} Alarm_severity_t;
typedef enum
{
InterModuleAlarmMsgTypeClearAlarm = 0,
InterModuleAlarmMsgTypeRaiseAlarm,
InterModuleAlarmMsgTypeShutdown,
InterModuleAlarmMsgTypeReboot
}InterModuleAlarmMsgType_t;
typedef struct
{
ubyte1 senderId; /* message originator */
InterModuleAlarmMsgType_t msgType; /* message type (MT_TRAP) */
MNET_MODULE_ID srcModuleId; /* Alarm source module ID */
MibTag errorTag; /* This module's ErrorTag */
AlarmCode_t code; /* Alarm code */
char arg1[ALARM_optionalArgSize]; /* argument 1 */
char arg2[ALARM_optionalArgSize]; /* argument 2 */
}InterModuleAlarmMsg_t;
typedef enum
{
stateDisabled=0,
stateEnabled=1
} EnableDisableState_t;
/* Printing and sending to logging module */
void alarm_print(char *format, ...);
#ifdef _UT
void HexDumper(ubyte1 *buffer, int length);
#define alarm_debug(XX) printf("[ALARM TRACE] %s ->", fname); alarm_print XX
#define alarm_error(XX) printf("[Alarm Error] %s ->", fname); alarm_print XX
#define alarm_warning(XX) printf("[Alarm Warning] %s ->", fname); alarm_print XX
#define alarm_dump(x,y); HexDumper(x, y);
#define alarm_fenter(XX); static char fname[] = XX;
#define alarm_fexit();
#else
#define alarm_fenter(XXX); \
DBG_FUNC(XXX, MY_LOGID); \
DBG_ENTER(); \
#define alarm_fexit(); DBG_LEAVE();
#define alarm_debug(XX) DBG_TRACE XX
#define alarm_error(XX) DBG_ERROR XX
#define alarm_warning(XX) DBG_WARNING XX
#define alarm_dump(x,y); DBG_HEXDUMP(x,y);
#endif
/* defined at alarm_main module */
int alarmTask();
int alarm_taskCreate();
void alarm_taskQuit ();
void alarm_msgPrint(char *format, ...);
void alarm_rebootHandler ( int startType );
/* In file alarm_modules.cpp */
void alarm_rptMdlStatus(int id, int mid, int ecode, int severity=Alarm_critical,
char* arg1= (char *) NULL, char* arg2= (char *) NULL);
void alarm_printStatus();
/* In file alarm_message.cpp */
void alarm_processMsg(char *inComingMsg);
/* It will go to alarm_event.cpp */
void alarm_clientMsg (char *, short, unsigned long);
void alarm_broadcast(const char *msg);
int alarm_generateNextId();
/* alarm_diskFile.cpp */
STATUS alarm_renameOldLogFile();
/* TimeSync api from Time Sync module */
extern void time_syncTime();
#endif

@ -0,0 +1,127 @@
/*********************************************************************/
/* */
/* (c) Copyright Cisco 2000 */
/* All Rights Reserved */
/* */
/*********************************************************************/
/*********************************************************************/
/* */
/* Version : 1.0 */
/* Status : Under development */
/* File : AlarmTask.h */
/* Author(s) : Bhawani Sapkota */
/* Create Date : 9/18/2000 */
/* Description : This file contains interface defination between */
/* Alarm Source (GP, GMC, GS) and Alarm Monitoring */
/* Server (APM1) */
/* */
/*********************************************************************/
/* REVISION HISTORY
/*___________________________________________________________________*/
/*----------+--------+-----------------------------------------------*/
/* Name | Date | Reason */
/*----------+--------+-----------------------------------------------*/
/* Bhawani |07/14/00| Initial Draft */
/* Bhawani |11/20/00| resturctured to share among GP, GMS and GS */
/* Bhawani |12/05/00| Added UDP server and client port so that the */
/* | | server and clients can reside on the same IP */
/* Bhawani |12/05/00| swaped the server and client port to make the */
/* | | original port as the server port. */
/*----------+--------+-----------------------------------------------*/
/*********************************************************************/
#if !defined(_ALARM_INTERFACE_H_)
#define _ALARM_INTERFACE_H_
#if defined(__cplusplus)
extern "C" {
#endif
#define ALARM_viperCellNameMaxSize 41
#define ALARM_viperCellIpMaxSize 16
#define ALARM_unknownAlarmId 0x00
/* Alarm Server's IP address is Gate Keeper's IP address */
/* Alarm Client/Server's Universal UPD ports */
#define ALARM_interfaceUdpPortClient 12791
#define ALARM_interfaceUdpPortServer 11788
#define ALARM_periodicUpdateInterval 300 /* seconds */
/* Alarm Source Type */
#define ALARM_srcTypViperCell 128
#define ALARM_srcTypViperBase 129
/* Alarm Message Type */
#define ALARM_msgTypSummaryUpdate 1
#define ALARM_msgTypAlarmEvent 2
typedef char sbyte1;
typedef short sbyte2;
typedef long sbyte4;
typedef unsigned char ubyte1;
typedef unsigned short ubyte2;
typedef unsigned long ubyte4;
/* Message header */
typedef struct AlarmInterfaceMsgHeader_{
ubyte1 alarmSrcType;
ubyte1 alarmMsgType;
ubyte2 alarmMsgLen;
}AlarmInterfaceMsgHeader;
#define ALARM_interfaceMsgHdrLen 4
/* Summary update data */
typedef struct AlarmSummaryUpdateData_{
ubyte4 alarmSrcIp;
sbyte1 alarmSrcName[ALARM_viperCellNameMaxSize];
ubyte1 alarmCriticalCount;
ubyte1 alarmMajorCount;
ubyte1 alarmMinorCount;
}AlarmSummaryUpdateData;
#define ALARM_summaryUpdateDataLen (7 + ALARM_viperCellNameMaxSize)
#define ALARM_summaryUpdateMsgLen (ALARM_interfaceMsgHdrLen + ALARM_summaryUpdateDataLen + sizeof(long))
#define ALARM_eventDataLen (28 + ALARM_viperCellNameMaxSize)
#define ALARM_eventMsgLen (ALARM_interfaceMsgHdrLen + ALARM_eventDataLen + sizeof(long))
/* Stubs for new event data */
typedef struct AlarmEventData_ {
ubyte4 alarmId;
ubyte4 alarmCode;
ubyte4 alarmTimestamp;
ubyte4 alarmSrcIp;
sbyte1 alarmSrcModuleName[ALARM_viperCellNameMaxSize];
ubyte4 alarmSrcModuleId;
ubyte4 opt1;
ubyte4 opt2;
}AlarmEventData;
/* Alarm Complete message */
typedef long Align;
typedef struct Alarm
{
AlarmInterfaceMsgHeader hdr;
union {
AlarmSummaryUpdateData summaryUpdateData;
AlarmEventData eventData;
}body;
Align x;
}AlarmViperCellToAmsMsg;
#if defined(__cplusplus)
}
#endif
#endif /* _ALARM_INTERFACE_H_ */

@ -0,0 +1,44 @@
##########################################################
#
# (c) Copyright Cisco 2000
# All Rights Reserved
#
# Use Examples:
#
# Case 1:
# make all VOB=GP10 -
# Places .out in VOB/bin directory
#
# Case 2:
# make all VOB=GP10 APPDIR=Host\<Application Name>\<Source Directory> -
# Places .o file(s) in VOB\$(APPDIR)\bin directory.
#
# <Application Name> = Name of Application directory
# <Source Directory> = application sub directory where the calling
# Makefile resides.
#
# Example: make all VOB=GP10 APPDIR=Host\vxTemplate\src
#
#
# Note: This make file must reference a VOB that
# has a defs.mk in the top level directory.
#
##########################################################
# TOP_OF_VOB must be defined before including l3defs.mk
TOP_OF_VOB = ..\..
# Name of this App's Directory
THIS_APP_DIR = Alarm
VOB2DIR = $(TOP_OF_VOB)\..\$(VOB)
BINDIR = ..\bin
include $(VOB2DIR)\l3defs.mk
all: $(MODULE_OBJS)
cleanall:
@for %f in ($(notdir $(MODULE_OBJS))) do \
$(RM) ..\bin\%f

@ -0,0 +1,198 @@
/*********************************************************************/
/* */
/* (c) Copyright Cisco 2000 */
/* All Rights Reserved */
/* */
/*********************************************************************/
/*********************************************************************/
/* */
/* Version : 1.0 */
/* Status : Under development */
/* File : AlarmTask.h */
/* Author(s) : Bhawani Sapkota */
/* Create Date : 07/11/99 */
/* Description : This file contains routines to perform disk I/O to */
/* save alarm to the disk file. */
/* */
/*********************************************************************/
/* REVISION HISTORY
/*___________________________________________________________________*/
/*----------+--------+-----------------------------------------------*/
/* Name | Date | Reason */
/*----------+--------+-----------------------------------------------*/
/* Bhawani |09/28/00| Initial Draft */
/* Bhawani |11/20/00| resturctured to share among GP, GMS and GS */
/*----------+--------+-----------------------------------------------*/
/*********************************************************************/
#include "AlarmTask.h"
#include "dirent.h"
#include "stat.h"
#include "time.h"
#include "string.h"
static unsigned long CyclicFileRecordIndex = 0;
STATUS AlarmTask::saveAlarm(const char* msg)
{
FILE *alarmfd;
alarm_fenter("AlarmTask::saveAlarm");
// Opens for reading and writing;
alarmfd = fopen(_logfilename, "r+");
if (alarmfd == NULL)
{
alarm_error(("Could not open alarm log file %s (Reason: %s)\n", _logfilename, strerror(errno)));
alarm_fexit();
return ERROR;
}
long fpos = ALARM_record_length*CyclicFileRecordIndex++;
CyclicFileRecordIndex = CyclicFileRecordIndex%ALARM_max_records;
fseek(alarmfd, fpos, SEEK_SET);
fputs(msg, alarmfd);
fclose(alarmfd);
alarm_debug(("Alarm Message successfully saved\n"));
alarm_fexit();
return OK;
}
STATUS AlarmTask::renameOldLogFile()
{
struct stat fileStat;
alarm_fenter("alarm_renameOldLogFile");
/* check if old Alarrm log file exists */
if (stat (_logfilename, &fileStat) == OK)
{
/* The file exist */
struct tm localTime;
struct tm *ltime = &localTime;
time_t longTime;
char *pdest;
char newFileName[ALARM_logFileMaxSize];
longTime = time(NULL);
ltime = localtime(&longTime);
strcpy(newFileName, _logfilename);
/* Assumes that file name is long enough */
pdest = strrchr(newFileName, ALARM_dirChar);
if( pdest != NULL )
{
sprintf(pdest+1, "AlarmLogAsOf_%d-%d-%d,%d:%d", ltime->tm_mon+1, ltime->tm_mday,
ltime->tm_year+1900,ltime->tm_hour, ltime->tm_min);
} else {
sprintf(newFileName, "AlarmLogAsOf_%d-%d-%d,%d:%d", ltime->tm_mon+1, ltime->tm_mday,
ltime->tm_year+1900,ltime->tm_hour, ltime->tm_min);
}
alarm_debug(("Renaming %s file to %s\n", _logfilename, newFileName));
if (rename(_logfilename, newFileName) == ERROR)
{
/* rename failed */
FILE *alarmfd;
alarm_error(("Could not rename old file (Reason: %s)\n", strerror(errno)));
alarm_warning(("Truncating the old alarm file: %s\n", _logfilename));
alarmfd = fopen(_logfilename, "w");
if (alarmfd == NULL)
{
alarm_error(("Could not truncate file(Reason: %s)\n",strerror(errno)));
} else {
fclose(alarmfd);
}
} else {
alarm_debug(("Old alarm file successfully renamed to %s\n", newFileName));
}
} else {
alarm_warning(("Old alarm log file \"%s\" does not exist.\n", _logfilename));
}
alarm_fexit();
return OK;
}
STATUS AlarmTask::getLastId(unsigned long *id)
{
FILE *alarmfd;
struct stat statBuff;
alarm_fenter("AlarmTask::getLastId");
STATUS status;
status = stat(_logfilename, &statBuff);
if ( status == ERROR // file does not exist
|| statBuff.st_size == 0 // newly created
|| statBuff.st_size % ALARM_record_length != 0 // corrupt file
|| statBuff.st_size > ALARM_max_records*ALARM_record_length // corrupt file
)
{
// if size is a zero, there was no alarm file
*id = 1;
CyclicFileRecordIndex = 0;
alarmfd = fopen(_logfilename, "w"); // truncate file
if (alarmfd != NULL)
fclose(alarmfd);
else
{
alarm_error(("Could not create %s for writing: %s\n", _logfilename, strerror(errno)));
}
} else {
alarm_debug(("Current Alarm disk file size = %d\n", statBuff.st_size));
if (statBuff.st_size < ALARM_max_records*ALARM_record_length)
{
// the size less then max size
CyclicFileRecordIndex = statBuff.st_size / ALARM_record_length;
*id = CyclicFileRecordIndex+1;
} else {
unsigned long id1, id2, i;
alarmfd= fopen(_logfilename, "r");
if (alarmfd == NULL)
{
alarm_error(("Cannot open() Alarm disk file %s to read (Reason: %s)\n", _logfilename, strerror(errno)));
*id =1;
CyclicFileRecordIndex = 0;
status = ERROR;
} else {
// file is ALARM_max_records*ALARM_record_length size
fseek(alarmfd, 0, SEEK_SET);
fscanf(alarmfd, "%u", &id1);
for(i=1; i< ALARM_max_records; i++)
{
fseek(alarmfd, i*ALARM_record_length, SEEK_SET);
fscanf(alarmfd, "%u", &id2);
if(id1> id2)
{
break;
} else {
id1 = id2;
}
}
CyclicFileRecordIndex = i % ALARM_max_records;
*id = id1+1;
}
}
}
alarm_fexit();
return status;
}

@ -0,0 +1,196 @@
/*********************************************************************/
/* */
/* (c) Copyright Cisco 2000 */
/* All Rights Reserved */
/* */
/*********************************************************************/
/*********************************************************************/
/* */
/* Version : 1.0 */
/* Status : Under development */
/* File : AlarmTask.h */
/* Author(s) : Bhawani Sapkota */
/* Create Date : 07/11/99 */
/* Description : contains alarm module message that interact with */
/* other module . */
/* */
/*********************************************************************/
/* REVISION HISTORY
/*___________________________________________________________________*/
/*----------+--------+-----------------------------------------------*/
/* Name | Date | Reason */
/*----------+--------+-----------------------------------------------*/
/* Bhawani |07/11/99| Initial Draft */
/* Bhawani |11/20/00| resturctured to share among GP, GMS and GS */
/*----------+--------+-----------------------------------------------*/
#ifndef _ALARM_EVENT_CPP_
#define _ALARM_EVENT_CPP_
#include "AlarmTask.h"
void alarm_clientMsg ( char * message, // the message from the client
short size, // size of the message
unsigned long clientId // unique client ID of the requester client
)
{
alarm_fenter("alarm_clientMsg");
alarm_debug(("Message receive from client (ID = %d)", clientId));
alarm_debug(("%s\n", message));
alarm_fexit();
}
void alarm_broadcast(const char *msg)
{
int len;
alarm_fenter("alarm_broadcast");
fflush(stdout);
len = strlen(msg);
//TcpSrvSendResponse(msg, len, kAlarmGpName);
alarm_debug(("Alarm message was sent\n"));
alarm_fexit();
}
JC_STATUS AlarmTask::msgqSend(unsigned int msgType, char * buffer, unsigned int nBytes)
{
return jcMsgQ->JCMsgQSend(this->jcMsgQ, msgType, MY_MODULE_ID, buffer, nBytes, JC_NO_WAIT, JC_MSG_Q_FIFO);
}
JC_STATUS AlarmTask::alarmSend
(
InterModuleAlarmMsgType_t mtype,
MNET_MODULE_ID mid,
MibTag moduleErrorTag,
AlarmCode_t alarm_code,
char *arg1,
char *arg2
)
{
InterModuleAlarmMsg_t alarmMsg;
memset(&alarmMsg, 0, sizeof(InterModuleAlarmMsg_t));
alarmMsg.errorTag = moduleErrorTag;
alarmMsg.code = alarm_code;
alarmMsg.senderId = (ubyte1) MY_MODULE_ID;
alarmMsg.msgType = mtype;
alarmMsg.srcModuleId = mid;
if (NULL != arg1)
{
strncpy(alarmMsg.arg1, arg1, ALARM_optionalArgSize-1);
}
if (NULL != arg2)
{
strncpy(alarmMsg.arg2, arg2, ALARM_optionalArgSize-1);
}
return AlarmTask::theAlarmTask->msgqSend
(InterModuleAlarmMsgTypeRaiseAlarm,
(char *) &alarmMsg,
sizeof(InterModuleAlarmMsg_t));
}
extern "C" JC_STATUS alarm_raise(MNET_MODULE_ID mid, MibTag moduleErrorTag, AlarmCode_t alarm_code)
{
return AlarmTask::theAlarmTask->alarmSend(InterModuleAlarmMsgTypeRaiseAlarm, mid, moduleErrorTag, alarm_code);
}
extern "C" JC_STATUS alarm_raise_args(MNET_MODULE_ID mid, MibTag moduleErrorTag, AlarmCode_t alarm_code, int arg1, int arg2)
{
char pszArg1[ALARM_optionalArgSize];
char pszArg2[ALARM_optionalArgSize];
sprintf (pszArg1, "%d", arg1);
sprintf (pszArg2, "%d", arg2);
return AlarmTask::theAlarmTask->alarmSend(InterModuleAlarmMsgTypeRaiseAlarm, mid, moduleErrorTag, alarm_code, pszArg1, pszArg2);
}
extern "C" JC_STATUS alarm_clear(MNET_MODULE_ID mid, MibTag moduleErrorTag, AlarmCode_t alarm_code)
{
return AlarmTask::theAlarmTask->alarmSend(InterModuleAlarmMsgTypeClearAlarm, mid, moduleErrorTag, alarm_code);
}
EnableDisableState_t AlarmTask::getOperationState()
{
long opState;
oam_getMibIntVar(MY_MIB_OPERATION_STATE, &opState);
return (EnableDisableState_t) opState;
}
void AlarmTask::setOperationState(EnableDisableState_t opstate )
{
EnableDisableState_t state = getOperationState();
if(state != opstate)
{
oam_setMibIntVar(MY_MODULE_ID, MY_MIB_OPERATION_STATE, opstate);
}
}
EnableDisableState_t AlarmTask::getMibAcessControlState()
{
long opState;
oam_getMibIntVar(MY_MIB_ACCESS_CONTROL_TAG, &opState);
return (EnableDisableState_t) opState;
}
void AlarmTask::setMibAcessControlState(EnableDisableState_t opstate )
{
EnableDisableState_t state = getMibAcessControlState();
alarm_fenter("AlarmTask::setMibAcessControlState");
if(state != opstate)
{
oam_setMibIntVar(MY_MODULE_ID, MY_MIB_ACCESS_CONTROL_TAG, opstate);
}
// local mib status
_mibAccessState = (opstate == stateEnabled);
if (_mibAccessState)
{
// This is the first time
initTimer->cancelTimer();
alarm_debug (("Mib access is now enabled\n"));
}
alarm_fexit();
}
void AlarmTask::setModuleLastError(MibTag moduleErrorTag, AlarmCode_t alarm_code)
{
oam_setMibIntVar(MY_MODULE_ID, moduleErrorTag, alarm_code);
}
void AlarmTask::populateSourceName()
{
const int kDisplayStringSize = 256;
char name[kDisplayStringSize];
memset(name, 0, kDisplayStringSize);
oam_getMibByteAry(MY_MIB_SOURCE_NAME, (ubyte1 *) name, kDisplayStringSize-1);
_sourceName = new char[strlen(name+1)];
strcpy(_sourceName, name);
}
char * AlarmTask::srcName()
{
return theAlarmTask->_sourceName;
}
#endif /* _ALARM_EVENT_CPP_ */

@ -0,0 +1,187 @@
/*********************************************************************/
/* */
/* (c) Copyright Cisco 2000 */
/* All Rights Reserved */
/* */
/*********************************************************************/
/*********************************************************************/
/* */
/* Version : 1.0 */
/* Status : Under development */
/* File : AlarmTask.h */
/* Author(s) : Bhawani Sapkota */
/* Create Date : 9/18/2000 */
/* Description : This file contains main routines for the alarm task */
/* */
/*********************************************************************/
/* REVISION HISTORY
/*___________________________________________________________________*/
/*----------+--------+-----------------------------------------------*/
/* Name | Date | Reason */
/*----------+--------+-----------------------------------------------*/
/* Bhawani |09/28/00| Initial Draft */
/* Bhawani |11/20/00| resturctured to share among GP, GMS and GS */
/*----------+--------+-----------------------------------------------*/
/*********************************************************************/
#include "AlarmTask.h"
#include "ctype.h"
#if defined( _TCP_SERVER_EXIST)
#include "TcpServer/TcpSrvApi.h"
#endif
AlarmTask * AlarmTask::theAlarmTask = NULL;
bool AlarmTask::isOneCreated = false;
AlarmTask::~AlarmTask()
{
alarm_fenter("AlarmTask::~AlarmTask");
alarm_debug(("Alarm Task instance is being deleted"));
delete jcMsgQ;
delete initTimer;
alarm_fexit();
}
int AlarmTask::entryPoint()
{
return theAlarmTask->startup();
}
int AlarmTask::startup()
{
int status;
unsigned int msgType;
MNET_MODULE_ID senderId;
unsigned int recvMsgsize;
alarm_fenter("alarmTask");
// Rename the old alarm file
// alarm_renameOldLogFile();
#if defined( _TCP_SERVER_EXIST)
// Register TCP server call back function
TcpSrvRegHand(kAlarmGpName, // Client Group Name (<= kClientGpNameMax)
alarm_clientMsg); // Function pointer to be called
#endif
/* now go into the message loop */
JCTaskEnterLoop();
_quit = false;
while(_quit == false)
{
/* get message from queue; if necessary wait for a maximum of ALARM_q_timeout ticks */
status = jcMsgQ->JCMsgQReceive(&jcMsgQ, &msgType, &senderId, _msgRecvBuff, &recvMsgsize, ALARM_q_timeout);
if (status == ERROR)
{
if (errno == S_objLib_OBJ_TIMEOUT)
{
/* Send heartbeat message to AMS in case it was down and now it has been up */
sendSummaryUpdateToAms();
continue;
}
}
else
{
alarm_processMsg(_msgRecvBuff);
sendSummaryUpdateToAms();
}
}
JCTaskNormExit();
closeSocket();
isOneCreated = false;
//delete theAlarmTask;
theAlarmTask = NULL;
/* The application need to unsunscribe trap before exiting. */
alarm_debug(("Alarm Task is exiting ... \n"));
alarm_fexit();
return OK;
}
/* print alarm messages */
void alarm_print(char *format, ...)
{
va_list marker;
va_start( marker, format ); /* Initialize variable arguments. */
vprintf(format, marker);
fflush(stdout);
va_end( marker ); /* Reset variable arguments. */
return;
}
#ifdef _UT
void HexDumper(ubyte1 *buffer, int length )
/*++ Purpose:
Put the inbound data in a hex dump format
Arguments:
buffer - points to the extension control block
length - specifies the number of bytes to dump --*/
{
int size;
int i;
int dwPos = 0;
while (length > 0) {
//
// Take min of 16 or length
//
size = min(16, length );
//
// Build text line
//
printf(" %04X ", dwPos );
for (i = 0; i < size; i++)
{
printf("%02X ", buffer[i] );
}
//
// Add spaces for short lines
//
while (i < 16)
{
printf(" " );
i++;
}
//
// Add ASCII chars
//
for (i = 0; i < size; i++)
{
if (isprint(buffer[i]))
{
printf("%c", buffer[i] );
} else {
printf("." );
}
}
printf("\n");
//
// Advance positions
//
length -= size;
dwPos += size;
buffer += size;
}
}
#endif /* _UT */

@ -0,0 +1,101 @@
/*********************************************************************/
/* */
/* (c) Copyright Cisco 2000 */
/* All Rights Reserved */
/* */
/*********************************************************************/
/*********************************************************************/
/* */
/* Version : 1.0 */
/* Status : Under development */
/* File : AlarmTask.h */
/* Author(s) : Bhawani Sapkota */
/* Create Date : 9/18/2000 */
/* Description : This file contains alarm task message processing */
/* routines */
/* */
/*********************************************************************/
/* REVISION HISTORY
/*___________________________________________________________________*/
/*----------+--------+-----------------------------------------------*/
/* Name | Date | Reason */
/*----------+--------+-----------------------------------------------*/
/* Bhawani |07/14/00| Initial Draft */
/* Bhawani |11/20/00| resturctured to share among GP, GMS and GS */
/*----------+--------+-----------------------------------------------*/
/*********************************************************************/
#ifndef _ALARM_MESSAGE_CPP_
#define _ALARM_MESSAGE_CPP_
#include "AlarmTask.h"
void alarm_processTrap(TrapMsg *trapMsg)
{
/* The Oam Message */
MibTag tag = trapMsg->mibTag;
int table = MIB_TBL(tag);
int mid = MIB_ITM(tag) - 1; // need to do this
alarm_fenter("alarm_processOamMsg");
alarm_fexit();
return;
}
void alarm_processAlarmMsg(InterModuleAlarmMsg_t * alarmMsg)
{
alarm_fenter("alarm_processAlarmMsg");
switch(alarmMsg->msgType)
{
case InterModuleAlarmMsgTypeClearAlarm:
AlarmTask::theAlarmTask->delAlarmEntry(alarmMsg->srcModuleId, alarmMsg->errorTag, alarmMsg->code);
break;
case InterModuleAlarmMsgTypeRaiseAlarm:
AlarmTask::theAlarmTask->addAlarmEntry(alarmMsg->srcModuleId, alarmMsg->errorTag, alarmMsg->code, alarmMsg->arg1, alarmMsg->arg2);
break;
case InterModuleAlarmMsgTypeShutdown:
AlarmTask::theAlarmTask->quit();
break;
case InterModuleAlarmMsgTypeReboot:
AlarmTask::theAlarmTask->quit();
break;
default:
alarm_warning(("Not recognized alarm message type (message type = %d)", alarmMsg->msgType));
break;
}
alarm_fexit();
return;
}
void alarm_processMsg(char *inComingMsg)
{
/* process the trap message here*/
alarm_fenter("alarm_processMsg");
alarm_debug(("A new message has just arrived.\n"));
switch(inComingMsg[0])
{
case MNET_MODULE_SNMP:
alarm_processTrap((TrapMsg *) inComingMsg);
break;
case MY_MODULE_ID:
alarm_processAlarmMsg((InterModuleAlarmMsg_t *) inComingMsg);
break;
default:
alarm_error(("Message from unsupported module (ID = %d)\n", inComingMsg[0]));
}
alarm_fexit();
}
#endif /* _ALARM_MESSAGE_CPP_ */

@ -0,0 +1,441 @@
/*********************************************************************/
/* */
/* (c) Copyright Cisco 2000 */
/* All Rights Reserved */
/* */
/*********************************************************************/
/*********************************************************************/
/* */
/* Version : 1.0 */
/* Status : Under development */
/* File : AlarmTask.h */
/* Author(s) : Bhawani Sapkota */
/* Create Date : 9/18/2000 */