Skip to content

Commit

Permalink
Merge pull request #107 from openwsn-berkeley/develop_FW-397
Browse files Browse the repository at this point in the history
FW-397. Fix.
  • Loading branch information
twatteyne committed Jul 1, 2015
2 parents 979774a + ac057cd commit c696106
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions software/openvisualizer/openvisualizer/openLbr/openLbr.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class OpenLbr(eventBusClient.eventBusClient):
The IPv6 Flow Label within a RPL domain
'''
#implementing http://tools.ietf.org/html/draft-thubert-6man-flow-label-for-rpl-03
FLOW_LABEL_RPL_DOMAIN = True
#FLOW_LABEL_RPL_DOMAIN = True

# http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml
IANA_PROTOCOL_IPv6ROUTE = 43
Expand Down Expand Up @@ -241,14 +241,14 @@ def _meshToV6_notif(self,sender,signal,data):
ipv6dic['next_header'] = ipv6dic['hop_next_header']

#===================================================================
if (self.FLOW_LABEL_RPL_DOMAIN and 'flags' in ipv6dic):
#if (self.FLOW_LABEL_RPL_DOMAIN and 'flags' in ipv6dic):
#if flow label si formatted following thubert-flow-label draft then check for loops as if it was a hop route header
if ((ipv6dic['flags'] & self.O_FLAG) == self.O_FLAG):
log.error("detected possible downstream link on upstream route from {0}".format(",".join(str(c) for c in ipv6dic['src_addr'])))
# if ((ipv6dic['flags'] & self.O_FLAG) == self.O_FLAG):
# log.error("detected possible downstream link on upstream route from {0}".format(",".join(str(c) for c in ipv6dic['src_addr'])))

if ((ipv6dic['flags'] & self.R_FLAG) == self.R_FLAG):
# if ((ipv6dic['flags'] & self.R_FLAG) == self.R_FLAG):
#error -- loop in the route
log.error("detected possible loop on upstream route from {0}".format(",".join(str(c) for c in ipv6dic['src_addr'])))
# log.error("detected possible loop on upstream route from {0}".format(",".join(str(c) for c in ipv6dic['src_addr'])))

#===================================================================

Expand Down Expand Up @@ -596,11 +596,11 @@ def lowpan_to_ipv6(self,data):
if (tf == self.IPHC_TF_3B):
pkt_ipv6['flow_label'] = ((pkt_lowpan[ptr]) << 16) + ((pkt_lowpan[ptr+1]) << 8) + ((pkt_lowpan[ptr+2]) << 0)
#print "flow label {0}".format(pkt_ipv6['flow_label'])
if (self.FLOW_LABEL_RPL_DOMAIN):
pkt_ipv6['flags']=((pkt_lowpan[ptr]) << 16);
#if (self.FLOW_LABEL_RPL_DOMAIN):
# pkt_ipv6['flags']=((pkt_lowpan[ptr]) << 16);
#log this situation as an error to see it
log.error("FLOW_LABEL_RPL_DOMAIN draft implemented")
pkt_ipv6['flow_label'] = 0
# log.error("FLOW_LABEL_RPL_DOMAIN draft implemented")
# pkt_ipv6['flow_label'] = 0
ptr = ptr + 3
elif (tf == self.IPHC_TF_ELIDED):
pkt_ipv6['flow_label'] = 0
Expand Down

0 comments on commit c696106

Please sign in to comment.