<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/19562" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2013-12-10T13:47:20-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/19562</id>

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2013-12-10T13:47:20-04:00</updated>

		<published>2013-12-10T13:47:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102290#p102290</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102290#p102290"/>
		<title type="html"><![CDATA[Add function to code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102290#p102290"><![CDATA[
<span style="color:red">I'd like to advice you that this is a heavily eggdrop-oriented forum, and I don't see how this is in any way related to eggdrops (or standard tcl, for that matter).<br><br>This seems to be heavily-reliant on a 3rd-party library related to some network analyzer? of which I can't find much usable information on the net.<br><br>All in all, I wouldn't get my hopes up too high here.</span><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Dec 10, 2013 1:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[chef06]]></name></author>
		<updated>2013-12-09T05:37:48-04:00</updated>

		<published>2013-12-09T05:37:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102282#p102282</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102282#p102282"/>
		<title type="html"><![CDATA[Add function to code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102282#p102282"><![CDATA[
Hello, I want to set up Smartbits. I found some examples script. It is ok. Now I want to create this script - add information about Counters ($GIG_STRUC_COUNTER_INFO).<br>I try add this function to code, but I can not display it.<br>Please can I some who help me create code. I do not undestand struct_new and etc.<br>Thaks very much.<div class="codebox"><p>Code: </p><pre><code>#################################################################################### GIGCount.tcl                                                                    ##                                                                                 ## - Sets a group of Gigabit cards (slot 1 and 3).                                 ##                                                                                 ## - We create an array of counter structures to hold the group counter data,      ##   then draw a simple report and fill in the counter data.                       ##                                                                                 ## NOTE: This script works on the following cards:                                 ##       - GX-1405(B)                                                              ##       - GX-1420(B)                                                              ##       - LAN-6200A                                                               ##       - LAN-6201A                                                               ##       - LAN-3300A/3310A                                                         ##                                                                                 ##################################################################################### If smartlib.tcl is not loaded, attempt to locate it at the default location.# The actual location is different on different platforms. if  {$tcl_platform(platform) == "windows"} {      set libPath "smartlib.tcl"} else {         set libPath "../../../../include/smartlib.tcl"}# if "smartlib.tcl" is not loaded, try to source it from the default pathif { ! [info exists __SMARTLIB_TCL__] } {     if {[file exists $libPath]} {          source $libPath} else {                           #Enter the location of the "smartlib.tcl" file or enter "Q" or "q" to quit         while {1} {                              puts "Could not find the file $libPath."                     puts "Enter the path of smartlib.tcl, or q to exit."                                gets stdin libPath                     if {$libPath == "q" || $libPath == "Q"} {                          exit                     }                      if {[file exists $libPath]} {                  source $libPath                          break                     }                 }    }}# If chassis is not currently linked prompt for IP and link  if {[ETGetLinkStatus] &lt; 0} {     puts "SmartBits not linked - Enter chassis IP address"     gets stdin ipaddr     set retval [ETSocketLink $ipaddr 16385]       if {$retval &lt; 0 } {  puts "Unable to connect to $ipaddr. Please try again."  exit     }}set iHub 0set iPort 0set iSlot 0set iSlot2 2#LIBCMD HTResetPort $RESET_FULL $iHub $iSlot $iPort#LIBCMD HTResetPort $RESET_FULL $iHub $iSlot2 $iPort# Create a group of two cardsLIBCMD HGSetGroup ""LIBCMD HGAddtoGroup $iHub $iSlot $iPortLIBCMD HGAddtoGroup $iHub $iSlot2 $iPort############################################## Initialize transmit parameters            ## single stream (no alternate) with no VFDs ##############################################LIBCMD HTSetStructure $GIG_STRUC_TX 1 1 1 - 0 $iHub $iSlot $iPort \-ulGap 9600LIBCMD HTSetStructure $GIG_STRUC_TX 0 0 0 - 0 $iHub $iSlot2 $iPort \-ulGap 9600# LIBCMD HTGetStructure $GIG_STRUC_COUNTER_INFO 0 0 0 \ myGIGCounterInfo \ 0 \ $iHub $iSlot $iPort# Reset CountersLIBCMD HGClearPort# Transmit for four seconds          puts "Sending Packets..."LIBCMD HGStart after 4000LIBCMD HGStopputs "Done!"# Pause a second to stabilize countersafter 1000################################################################################ Counters                                                                    ## - We create an array of two structures of type HTCountStructure             ##   then call HGGetCounters to retireve data from cards.                      ##   This is the same procedure used for all L2 cards.                         ##                                                                             ## - We add 1 to $iSlot and $iSlot2 to match the slot number on the chassis    ##                                                                             ## - Use format to align count data (10d allows 10 spaces decimal output).     ################################################################################struct_new cs HTCountStructure*2LIBCMD HGGetCounters csputs "------------------------------------------------------------"puts "Vysledky testu"puts "------------------------------------------------------------"puts "                Card [expr $iSlot + 1]Card [expr $iSlot2 +1]"puts "------------------------------------------------------------"puts "Tx Packets [format %10d "$cs(0.TmtPkt)"]|  [format %10d "$cs(1.TmtPkt)"]"puts "Rx Packets [format %10d "$cs(0.RcvPkt)"]|  [format %10d "$cs(1.RcvPkt)"]"puts "Collisions[format %10d "$cs(0.Collision)"]|  [format %10d "$cs(1.Collision)"]"puts "Recvd Trigger[format %10d "$cs(0.RcvTrig)"]|  [format %10d "$cs(1.RcvTrig)"]"puts "CRC Errors[format %10d "$cs(0.CRC)"]|  [format %10d "$cs(1.CRC)"]"# puts "Nmb of    [format %10d "$cs(0.RcvPktRate)"]|  [format %10d "$cs(1.RcvPktRate)"]"puts "------------------------------------------------------------"#Unset the structureunset csputs "UnLinking from the chassis.."ETUnLinkputs "DONE!"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12306">chef06</a> — Mon Dec 09, 2013 5:37 am</p><hr />
]]></content>
	</entry>
	</feed>
