Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 237221 Details for
Bug 421063
Implementation of IPv6 to jslp
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Implementation of jslp to ipv6
jslp_patch (text/plain), 11.82 KB, created by
Mohammad Jamal MohiUddin
on 2013-11-05 22:54:11 EST
(
hide
)
Description:
Implementation of jslp to ipv6
Filename:
MIME Type:
Creator:
Mohammad Jamal MohiUddin
Created:
2013-11-05 22:54:11 EST
Size:
11.82 KB
patch
obsolete
>diff -rauB /home/jumbo/Downloads/ecf-master/protocols/bundles/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/AdvertiserImpl.java ecf-master/protocols/bundles/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/AdvertiserImpl.java >--- /home/jumbo/Downloads/ecf-master/protocols/bundles/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/AdvertiserImpl.java 2013-11-01 23:11:52.000000000 +0530 >+++ ecf-master/protocols/bundles/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/AdvertiserImpl.java 2013-11-05 16:43:32.380579377 +0530 >@@ -11,6 +11,21 @@ > * Markus Alexander Kuppe - enhancements and bug fixes > * > *****************************************************************************/ >+ >+/**************************************************************************** >+ * Copyright (c) 2013 Md.Jamal MohiUddin, >+ * Ubiquitous Computing, C-DAC Hyderabad. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Md.Jamal MohiUddin - Updation to IPv6 >+ * P Sowjanya - Updation to IPv6 >+ * >+*****************************************************************************/ >+ > package ch.ethz.iks.slp.impl; > > import java.net.InetAddress; >@@ -112,6 +127,7 @@ > .getServiceType(), scopes, SLPUtils.dictToAttrList(attributes), > locale); > try { >+ SLPCore.initMulticastSocket(url.toString()); > reg.address = InetAddress.getLocalHost(); > } catch (UnknownHostException e) { > reg.address = SLPCore.getMyIP(); >diff -rauB /home/jumbo/Downloads/ecf-master/protocols/bundles/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/SLPCore.java ecf-master/protocols/bundles/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/SLPCore.java >--- /home/jumbo/Downloads/ecf-master/protocols/bundles/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/SLPCore.java 2013-11-01 23:11:52.000000000 +0530 >+++ ecf-master/protocols/bundles/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/SLPCore.java 2013-11-06 09:12:08.021573395 +0530 >@@ -12,6 +12,20 @@ > * > *****************************************************************************/ > >+/**************************************************************************** >+ * Copyright (c) 2013 Md.Jamal MohiUddin, >+ * Ubiquitous Computing, C-DAC Hyderabad. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Md.Jamal MohiUddin - Updation to IPv6 >+ * P Sowjanya - Updation to IPv6 >+ * >+*****************************************************************************/ >+ > package ch.ethz.iks.slp.impl; > > import java.io.ByteArrayInputStream; >@@ -77,10 +91,53 @@ > */ > static final String SLP_MCAST_ADDRESS = "239.255.255.253"; > >+ >+ /** >+ * SVRLOC multicast group id is for receiving >+ * Attribute Request and Service Type Request >+ * Messages >+ */ >+ >+ static final String SLP_SVRLOC = "FF02::123"; >+ >+ /** >+ * >+ */ >+ >+ static final InetAddress SVRLOC=null; >+ >+ >+ /** >+ * SVRLOC-DA group is used for receiving >+ * DA Advertisements >+ */ >+ >+ >+ static final String SLP_SVRLOC_DA="FF02::116"; >+ > /** > * > */ >- static final InetAddress MCAST_ADDRESS; >+ >+ >+ >+ static final InetAddress DA_ADDRESS; >+ >+ static final InetAddress SVRLOC_ADDRESS; >+ >+ >+ /** >+ *Service Request Multicast Group Id >+ */ >+ >+ static final String SLP_ServiceRqst=""; >+ >+ /** >+ * >+ */ >+ >+ static InetAddress ServiceRqst=null; >+ > > /** > * the SLP configuration. >@@ -257,14 +314,17 @@ > // initialize the XID with a random number > nextXid = (short) Math.round(Math.random() * Short.MAX_VALUE); > >- InetAddress mcast = null; >+ InetAddress SVRLOC=null; >+ InetAddress SVRLOC_DA=null; > try { >- mcast = InetAddress.getByName(SLPCore.SLP_MCAST_ADDRESS); >+ SVRLOC = InetAddress.getByName(SLPCore.SLP_SVRLOC); >+ SVRLOC_DA = InetAddress.getByName(SLPCore.SLP_SVRLOC_DA); > } catch (UnknownHostException e1) { > e1.printStackTrace(); > } > >- MCAST_ADDRESS = mcast; >+ DA_ADDRESS=SVRLOC_DA; >+ SVRLOC_ADDRESS=SVRLOC; > } > > protected static void init() { >@@ -327,9 +387,18 @@ > } > > // a pure UA doesn't need a multicast listener which is only required by a SA or DA >- protected static void initMulticastSocket() { >+ protected static void initMulticastSocket(String URL) { > if(isMulticastSocketInitialized) { >- return; >+ try{ >+ >+ ServiceRqst= slp_hash(URL.toString(),URL.toString().length()); >+ System.out.println("joining the group service request "+ServiceRqst); >+ mtcSocket.joinGroup(ServiceRqst); >+ >+ }catch(Exception e){ >+ e.printStackTrace(); >+ } >+ return; > } > isMulticastSocketInitialized = true; > >@@ -343,7 +412,10 @@ > platform.logDebug("Setting multicast socket interface to " + myIPs[0] + " failed.",t); > } > } >- mtcSocket.joinGroup(MCAST_ADDRESS); >+ mtcSocket.joinGroup(SVRLOC_ADDRESS); >+ mtcSocket.joinGroup(DA_ADDRESS); >+ ServiceRqst= slp_hash(URL.toString(),URL.toString().length()); >+ mtcSocket.joinGroup(ServiceRqst); > } catch (BindException be) { > platform.logError(be.getMessage(), be); > throw new RuntimeException("You have to be root to open port " >@@ -614,11 +686,11 @@ > SLP_DA_TYPE), scopes, null, SLPCore.DEFAULT_LOCALE); > sreq.xid = SLPCore.nextXid(); > sreq.scopeList = scopes; >- sreq.address = MCAST_ADDRESS; >+ sreq.address = DA_ADDRESS; > sreq.multicast = true; > byte[] bytes = sreq.getBytes(); > DatagramPacket d = new DatagramPacket(bytes, bytes.length, >- MCAST_ADDRESS, SLP_PORT); >+ DA_ADDRESS, SLP_PORT); > platform.logTraceMessage("SENT " + sreq + "(udp multicast)"); > setupReceiverThread(socket, CONFIG.getWaitTime(), sreq); > try { >@@ -762,7 +834,7 @@ > try { > > long start = System.currentTimeMillis(); >- >+ InetAddress Destination; > List replyQueue = new ArrayList(); > List responders = new ArrayList(); > List responses = new ArrayList(); >@@ -791,8 +863,28 @@ > throw e; > } > } >+ byte type=SLPMessage.getMessageType(msg); >+ switch(type) >+ { >+ case SLPMessage.SRVRQST: >+ ServiceRequest srq=(ServiceRequest)msg; >+ msg.address=slp_hash(srq.serviceType.toString(),srq.serviceType.toString().length()); >+ Destination=msg.address; >+ break; >+ >+ case SLPMessage.ATTRRQST: >+ case SLPMessage.SRVTYPERQST: >+ msg.address=SVRLOC_ADDRESS; >+ Destination=msg.address; >+ break; >+ >+ default: >+ System.out.println("\n Unknown request Message has been received"+SLPMessage.getType(type)); >+ return null; >+ > >- msg.address = MCAST_ADDRESS; >+ >+ } > ReplyMessage reply; > > for (int i = 0; i < myIPs.length; i++) { >@@ -833,8 +925,7 @@ > > // send the message > DatagramPacket p = new DatagramPacket(message, >- message.length, InetAddress >- .getByName(SLP_MCAST_ADDRESS), SLP_PORT); >+ message.length, Destination, SLP_PORT); > > try { > socket.send(p); >@@ -921,6 +1012,56 @@ > return false; > } > >+ /*Hash Algorithm for SLP Service Type String(RFC 3111)*/ >+ >+ static InetAddress slp_hash( String pc, int len) >+ { >+ String ip="FF02::1:1"; >+ InetAddress Service_ip=null;//= InetAddress.getByName("FF02::1:1000"); >+ /*An unsigned 32-bit value v is initialized to 0.Each byte of the character is considered consecutively*/ >+ int h=0; >+ String Extract= extract_Service(pc); >+ >+ for(int i=0;i<Extract.length();i++) >+ { >+ /*The current value v is multiplied by 33.then the value of the current string byte is added ,Each byte in the service type string is processed in this manner*/ >+ h*=33; >+ h+=Extract.charAt(i); >+ } >+ /*The result is contained in the low order 10 bits of v*/ >+ int j=(0x3ff&h); >+ //Concatenating the value with the IP >+ ip=ip+Integer.toHexString(j); >+ try{ >+ Service_ip = InetAddress.getByName(ip); >+ } >+ catch(Exception e) >+ { >+ e.printStackTrace(); >+ } >+ return Service_ip; >+ >+ >+ } >+ >+ >+ static String extract_Service(String url) >+ { >+ >+ int position=url.indexOf(':',0); >+ if(position==-1) >+ return url; >+ position=url.indexOf(':', position+1); >+ if(position==-1) >+ return url; >+ String substring= url.substring(0, position); >+ return substring; >+ >+ } >+ >+ >+ >+ > /** > * setup a new receiver thread for a socket. > * >diff -rauB /home/jumbo/Downloads/ecf-master/protocols/bundles/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/SLPMessage.java ecf-master/protocols/bundles/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/SLPMessage.java >--- /home/jumbo/Downloads/ecf-master/protocols/bundles/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/SLPMessage.java 2013-11-01 23:11:52.000000000 +0530 >+++ ecf-master/protocols/bundles/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/SLPMessage.java 2013-11-06 09:22:08.165575405 +0530 >@@ -11,6 +11,22 @@ > * Markus Alexander Kuppe - enhancements and bug fixes > * > *****************************************************************************/ >+ >+ >+/**************************************************************************** >+ * Copyright (c) 2013 Md.Jamal MohiUddin, >+ * Ubiquitous Computing, C-DAC Hyderabad. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Md.Jamal MohiUddin - Updation to IPv6 >+ * P Sowjanya - Updation to IPv6 >+ * >+*****************************************************************************/ >+ > package ch.ethz.iks.slp.impl; > > import java.io.ByteArrayOutputStream; >@@ -493,4 +510,15 @@ > rule.visit(visitor); > return visitor.getAttributes(); > } >+ >+ /** >+ *Returns the Type of The Request Message >+ * >+ */ >+ >+ static byte getMessageType(RequestMessage msg) >+ { >+ return msg.funcID; >+ >+ } > } >diff -rauB /home/jumbo/Downloads/ecf-master/protocols/bundles/ch.ethz.iks.slp/standalone/inclusions/ch/ethz/iks/slp/ServiceLocationManager.java ecf-master/protocols/bundles/ch.ethz.iks.slp/standalone/inclusions/ch/ethz/iks/slp/ServiceLocationManager.java >--- /home/jumbo/Downloads/ecf-master/protocols/bundles/ch.ethz.iks.slp/standalone/inclusions/ch/ethz/iks/slp/ServiceLocationManager.java 2013-11-01 23:11:52.000000000 +0530 >+++ ecf-master/protocols/bundles/ch.ethz.iks.slp/standalone/inclusions/ch/ethz/iks/slp/ServiceLocationManager.java 2013-11-05 16:42:06.412579122 +0530 >@@ -11,6 +11,22 @@ > * Markus Alexander Kuppe - enhancements and bug fixes > * > *****************************************************************************/ >+ >+/**************************************************************************** >+ * Copyright (c) 2013 Md.Jamal MohiUddin, >+ * Ubiquitous Computing, C-DAC Hyderabad. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Md.Jamal MohiUddin - Updation to IPv6 >+ * P Sowjanya - Updation to IPv6 >+ * >+*****************************************************************************/ >+ >+ > package ch.ethz.iks.slp; > > import java.util.Locale; >@@ -65,6 +81,7 @@ > init(); > if (locator != null) { > try { >+ //TODO::We have to Initialize the Multicast Socket for UA also for receiving DA Advt Messages > return (Locator) locator.newInstance(new Object[] { locale }); > } catch (Exception e) { > throw new ServiceLocationException( >@@ -90,7 +107,6 @@ > public static Advertiser getAdvertiser(final Locale locale) > throws ServiceLocationException { > init(); >- SLPCore.initMulticastSocket(); > if (advertiser != null) { > try { > return (Advertiser) advertiser
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 421063
:
237191
|
237220
|
237221
|
237223
|
238155
|
238156