fixed topic search
diff --git a/scripts/addDPN.sh b/scripts/addDPN.sh
index 9a07776..9c77d37 100755
--- a/scripts/addDPN.sh
+++ b/scripts/addDPN.sh
@@ -1,3 +1,4 @@
+#!/bin/bash
curl -i --header "Content-type: application/json" --request POST -u onos:rocks --data '{
"dpns": [
{
@@ -11,3 +12,4 @@
}
]
}' 'http://localhost:8181/onos/restconf/data/ietf-dmm-fpcagent:tenants/tenant=default/fpc-topology'
+./getTenants.sh
\ No newline at end of file
diff --git a/scripts/createRPC.sh b/scripts/createRPC.sh
index e920070..621f6df 100755
--- a/scripts/createRPC.sh
+++ b/scripts/createRPC.sh
@@ -5,44 +5,6 @@
"client-id": "1",
"contexts": [
{
- "context-id": 202374886,
- "delegating-ip-prefixes": [
- "192.168.1.5/32"
- ],
- "dl": {
- "dpn-parameters": {},
- "mobility-tunnel-parameters": {
- "tunnel-identifier": "2222",
- "tunnel-type": "gtpv1"
- },
- "tunnel-local-address": "192.168.1.1",
- "tunnel-remote-address": "10.1.1.1"
- },
- "dpn-group": "foo",
- "dpns": [
- {
- "direction": "uplink",
- "dpn-id": "1",
- "dpn-parameters": {}
- }
- ],
- "ebi": "5",
- "imsi": "9135551234",
- "instructions": {
- "instr-3gpp-mob": "session uplink"
- },
- "lbi": "5",
- "ul": {
- "dpn-parameters": {},
- "mobility-tunnel-parameters": {
- "tunnel-identifier": "1111",
- "tunnel-type": "gtpv1"
- },
- "tunnel-local-address": "192.168.1.1",
- "tunnel-remote-address": "10.1.1.1"
- }
- },
- {
"context-id": 202374887,
"delegating-ip-prefixes": [
"192.168.1.5/32"
diff --git a/scripts/forwarder_subscriber_with_ACK.py b/scripts/forwarder_subscriber_with_ACK.py
index e3826a5..fbc5088 100755
--- a/scripts/forwarder_subscriber_with_ACK.py
+++ b/scripts/forwarder_subscriber_with_ACK.py
@@ -32,15 +32,7 @@
def signal_handler(signal, frame):
print "\nExiting... Sending DPN Status Indication message with Status = GOODBYE"
pub_socket.send("%s" % (struct.pack("!BBBBIB",2,12,topicId,2,source,len(nodeId)) + nodeId + struct.pack('!B',len(networkId)) + networkId))
- count = 0
- while True:
- time.sleep(1)
- sys.stdout.write("\r"+str(5-count)+" ")
- sys.stdout.flush()
- count += 1
- if(count > 5):
- print "\n"
- sys.exit(0)
+ sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
@@ -70,18 +62,19 @@
print "Ready to receive messages. Press Ctrl+C when ready to exit."
-rec_port = "5560"
-send_port = "5559"
+subscriber_uri = "tcp://localhost:5560"
+publisher_uri = "tcp://localhost:5559"
# Socket to talk to server
context = zmq.Context()
-socket = context.socket(zmq.SUB)
+sub_socket = context.socket(zmq.SUB)
pub_socket = context.socket(zmq.PUB)
-socket.connect ("tcp://localhost:%s" % rec_port)
-pub_socket.connect("tcp://localhost:%s" % send_port)
+sub_socket.connect(subscriber_uri)
+pub_socket.connect(publisher_uri)
topicfilter = ""
controller_topic= 252
-socket.setsockopt(zmq.SUBSCRIBE, topicfilter)
-print "Listening to port ", rec_port
+sub_socket.setsockopt(zmq.SUBSCRIBE, topicfilter)
+print "Subscriber to ", subscriber_uri
+print "Publisher to ", publisher_uri
print "DPN Lifecycle start up . . . Please wait."
async_result = pool.apply_async(sendAssignId,(pub_socket,))
@@ -94,12 +87,14 @@
msgnum5count = 0
msgnum6count = 0
for update_nbr in range(900000):
- string = socket.recv()
+ string = sub_socket.recv()
ts = time.time()
st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')
topic,msgnum = struct.unpack('!BB',string[:2])
+ print 'received %s %s' % (topic, msgnum)
+
if topic == 1 and msgnum == 10: #Assign_Id
top,msg,topId,src,nodeIdLen = struct.unpack('!BBBIB',string[:8])
top,msg,topId,src,nodeIdLen,nodeId1,networkIdLen = struct.unpack('!BBBIB'+str(nodeIdLen)+'sB',string[:8+nodeIdLen+1])
@@ -250,4 +245,4 @@
print '================'
print 'Total = ', count, 'msgnum1 count', msgnum1count, 'msgnum2 count', msgnum2count, 'msgnum3 count', msgnum3count, 'msgnum4 count', msgnum4count,'msgnum5 count', msgnum5count, 'msgnum6 count', msgnum6count
-socket.close()
+sub_socket.close()
diff --git a/scripts/updateRPC.sh b/scripts/updateRPC.sh
new file mode 100755
index 0000000..de934bf
--- /dev/null
+++ b/scripts/updateRPC.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+curl -X POST --header 'Content-Type: application/json' -u onos:rocks --header 'Accept: application/json' -d '{
+ "input": {
+ "admin-state": "enabled",
+ "client-id": "1",
+ "contexts": [
+ {
+ "context-id": 202374887,
+ "delegating-ip-prefixes": [
+ "192.168.1.5/32"
+ ],
+ "dl": {
+ "dpn-parameters": {},
+ "mobility-tunnel-parameters": {
+ "tunnel-identifier": "2222",
+ "tunnel-type": "gtpv1"
+ },
+ "tunnel-local-address": "192.168.1.1",
+ "tunnel-remote-address": "10.1.1.1"
+ },
+ "dpn-group": "foo",
+ "dpns": [
+ {
+ "direction": "uplink",
+ "dpn-id": "1",
+ "dpn-parameters": {}
+ }
+ ],
+ "ebi": "5",
+ "imsi": "9135551234",
+ "instructions": {
+ "instr-3gpp-mob": "session uplink"
+ },
+ "lbi": "5",
+ "ul": {
+ "dpn-parameters": {},
+ "mobility-tunnel-parameters": {
+ "tunnel-identifier": "1111",
+ "tunnel-type": "gtpv1"
+ },
+ "tunnel-local-address": "192.168.1.1",
+ "tunnel-remote-address": "10.1.1.1"
+ }
+ }
+ ],
+ "op-id": "1",
+ "op-ref-scope": "op",
+ "op-type": "update",
+ "session-state": "complete"
+ }
+}' 'http://localhost:8181/onos/restconf/operations/ietf-dmm-fpcagent:configure' | python -m json.tool