Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Get rid of using ProtocolHandlerFactory, part 1"
[controller.git]
/
opendaylight
/
sal
/
api
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
sal
/
utils
/
NetUtils.java
diff --git
a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/NetUtils.java
b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/NetUtils.java
index 1ced9dd9e43b2922d00120ce46648bad0704c50f..dc341625af642395872a3e2860a9d0fcc6f1ce3b 100644
(file)
--- a/
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/NetUtils.java
+++ b/
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/NetUtils.java
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2013
-2014
Cisco Systems, Inc. and others. 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,
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@
-43,7
+43,7
@@
public abstract class NetUtils {
/**
* Constant holding the broadcast MAC address
*/
/**
* Constant holding the broadcast MAC address
*/
- p
ublic
static final byte[] BroadcastMACAddr = {-1, -1, -1, -1, -1, -1};
+ p
rivate
static final byte[] BroadcastMACAddr = {-1, -1, -1, -1, -1, -1};
/**
* Converts a 4 bytes array into an integer number
/**
* Converts a 4 bytes array into an integer number
@@
-482,7
+482,7
@@
public abstract class NetUtils {
* @return the int variable containing the unsigned byte value
*/
public static int getUnsignedByte(byte b) {
* @return the int variable containing the unsigned byte value
*/
public static int getUnsignedByte(byte b) {
- return
(b > 0) ? (int) b : (b & 0x7F | 0x80)
;
+ return
b & 0xFF
;
}
/**
}
/**
@@
-493,7
+493,7
@@
public abstract class NetUtils {
* @return the int variable containing the unsigned short value
*/
public static int getUnsignedShort(short s) {
* @return the int variable containing the unsigned short value
*/
public static int getUnsignedShort(short s) {
- return
(s > 0) ? (int) s : (s & 0x7FFF | 0x8000)
;
+ return
s & 0xFFFF
;
}
/**
}
/**
@@
-515,10
+515,9
@@
public abstract class NetUtils {
/**
* Returns Broadcast MAC Address
*
/**
* Returns Broadcast MAC Address
*
- * @return the byte array containing broadcas
e
t mac address
+ * @return the byte array containing broadcast mac address
*/
public static byte[] getBroadcastMACAddr() {
return Arrays.copyOf(BroadcastMACAddr, BroadcastMACAddr.length);
}
*/
public static byte[] getBroadcastMACAddr() {
return Arrays.copyOf(BroadcastMACAddr, BroadcastMACAddr.length);
}
-
}
}