trisulrp 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+ gem "ruby-protocol-buffers", ">= 0.8.5"
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "shoulda", ">= 0"
10
+ gem "bundler", "~> 1.0.0"
11
+ gem "jeweler", "~> 1.5.2"
12
+ gem "rcov", ">= 0"
13
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 vivek
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,19 @@
1
+ = trisulrp
2
+
3
+ Description goes here.
4
+
5
+ == Contributing to trisulrp
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
+ * Fork the project
10
+ * Start a feature/bugfix branch
11
+ * Commit and push until you are happy with your contribution
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2010 vivek. See LICENSE.txt for
18
+ further details.
19
+
data/Rakefile ADDED
@@ -0,0 +1,54 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'rake'
11
+
12
+ require 'jeweler'
13
+ Jeweler::Tasks.new do |gem|
14
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
+ gem.name = "trisulrp"
16
+ gem.homepage = "http://github.com/vivekrajan/trisulrp"
17
+ gem.license = "MIT"
18
+ gem.summary = %Q{trisul trp}
19
+ gem.description = %Q{This gem deals about the trisul remote protocol}
20
+ gem.email = "vivek_rajagopal@yahoo.com"
21
+ gem.authors = ["vivek"]
22
+ # Include your dependencies below. Runtime dependencies are required when using your gem,
23
+ # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
24
+ # gem.add_runtime_dependency 'jabber4r', '> 0.1'
25
+ # gem.add_development_dependency 'rspec', '> 1.2.3'
26
+ gem.add_dependency 'ruby-protocol-buffers' , '>= 0.8.5'
27
+ end
28
+ Jeweler::RubygemsDotOrgTasks.new
29
+
30
+ require 'rake/testtask'
31
+ Rake::TestTask.new(:test) do |test|
32
+ test.libs << 'lib' << 'test'
33
+ test.pattern = 'test/**/test_*.rb'
34
+ test.verbose = true
35
+ end
36
+
37
+ require 'rcov/rcovtask'
38
+ Rcov::RcovTask.new do |test|
39
+ test.libs << 'test'
40
+ test.pattern = 'test/**/test_*.rb'
41
+ test.verbose = true
42
+ end
43
+
44
+ task :default => :test
45
+
46
+ require 'rake/rdoctask'
47
+ Rake::RDocTask.new do |rdoc|
48
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
49
+
50
+ rdoc.rdoc_dir = 'rdoc'
51
+ rdoc.title = "trisulrp #{version}"
52
+ rdoc.rdoc_files.include('README*')
53
+ rdoc.rdoc_files.include('lib/**/*.rb')
54
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.2.2
data/examples/strp.rb ADDED
@@ -0,0 +1,38 @@
1
+ # Trisul Remote Protocol TRP Demo script
2
+ # Akhil.M & Dhinesh.K (c) 2010 Unleash Networks
3
+ require 'rubygems'
4
+
5
+ require './trplib'
6
+ include TRPLib
7
+
8
+ GUID_CG_APP = "{C51B48D4-7876-479E-B0D9-BD9EFF03CE2E}"
9
+
10
+ raise "Usage : strp host port" unless ARGV.length==2
11
+
12
+ # demo a counter group info request
13
+ # get information about the application counter group
14
+
15
+ trp_conn=TRPLib::connect_trp(ARGV.shift,ARGV.shift,"Demo_Client.crt","Demo_Client.key")
16
+
17
+
18
+ from_tm=to_tm=nil
19
+ req=TRPLib::mk_counter_group_info_request(GUID_CG_APP)
20
+ TRPLib::get_trp_response(trp_conn,req) do |resp|
21
+ TRPLib::print_counter_group_info_response(resp)
22
+
23
+ from_tm = Time.at(resp.counter_group_info_response.group_details[0].time_interval.from.tv_sec)
24
+ to_tm = Time.at(resp.counter_group_info_response.group_details[0].time_interval.to.tv_sec)
25
+ end
26
+
27
+ # demo for each session id and their full info
28
+ req=TRPLib::mk_key_session_activity_request("0A.01.A0.E8", from_tm, to_tm)
29
+ get_trp_response(trp_conn,req) do |resp|
30
+ TRPLib::print_key_session_activity_response(resp)
31
+ resp.key_session_activity_response.sessions.each do|session|
32
+ req=TRPLib::mk_session_item_request(session.slice_id,session.session_id)
33
+ get_trp_response(trp_conn,req) do |resp|
34
+ TRPLib::print_session_item_response(resp)
35
+ end
36
+ end
37
+ end
38
+
data/lib/trisulrp.rb ADDED
@@ -0,0 +1,15 @@
1
+ $:.unshift(File.dirname(__FILE__)) unless
2
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
+
4
+ # =TRISUL TRP
5
+ # #
6
+ # #
7
+ # # Author:: Vivek Rajagopalan
8
+ # # Date:: 30 Dec 2010
9
+
10
+ module TRP
11
+ end
12
+
13
+ require 'rubygems'
14
+ require 'trplib.rb'
15
+ require 'trp.pb'