Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
floodlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
croft1
floodlight
Commits
59a0e1e9
Commit
59a0e1e9
authored
11 years ago
by
kwang-bsn
Browse files
Options
Downloads
Patches
Plain Diff
BSC-3818 BSC-3817 Send SNMP traps for switch connect and port changes
parent
8cccb549
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/floodlightcontroller/core/internal/Controller.java
+32
-2
32 additions, 2 deletions
...va/net/floodlightcontroller/core/internal/Controller.java
with
32 additions
and
2 deletions
src/main/java/net/floodlightcontroller/core/internal/Controller.java
+
32
−
2
View file @
59a0e1e9
...
@@ -250,6 +250,36 @@ public class Controller implements IFloodlightProviderService,
...
@@ -250,6 +250,36 @@ public class Controller implements IFloodlightProviderService,
Boolean
.
parseBoolean
(
System
.
getProperty
(
"overload_drop"
,
"false"
));
Boolean
.
parseBoolean
(
System
.
getProperty
(
"overload_drop"
,
"false"
));
protected
final
LoadMonitor
loadmonitor
=
new
LoadMonitor
(
log
);
protected
final
LoadMonitor
loadmonitor
=
new
LoadMonitor
(
log
);
private
class
NotificationSwitchListener
implements
IOFSwitchListener
{
@Override
public
void
switchAdded
(
long
switchId
)
{
notifier
.
postNotification
(
"Switch "
+
HexString
.
toHexString
(
switchId
)
+
" connected."
);
}
@Override
public
void
switchRemoved
(
long
switchId
)
{
notifier
.
postNotification
(
"Switch "
+
HexString
.
toHexString
(
switchId
)
+
" disconnected."
);
}
@Override
public
void
switchActivated
(
long
switchId
)
{
}
@Override
public
void
switchPortChanged
(
long
switchId
,
ImmutablePort
port
,
PortChangeType
type
)
{
String
msg
=
String
.
format
(
"Switch %s port %s changed: %s"
,
HexString
.
toHexString
(
switchId
),
port
.
getName
(),
type
.
toString
());
notifier
.
postNotification
(
msg
);
}
@Override
public
void
switchChanged
(
long
switchId
)
{
}
}
public
static
class
Counters
{
public
static
class
Counters
{
public
static
final
String
prefix
=
Controller
.
class
.
getPackage
().
getName
();
public
static
final
String
prefix
=
Controller
.
class
.
getPackage
().
getName
();
public
IDebugCounter
setRoleEqual
;
public
IDebugCounter
setRoleEqual
;
...
@@ -1174,7 +1204,6 @@ public class Controller implements IFloodlightProviderService,
...
@@ -1174,7 +1204,6 @@ public class Controller implements IFloodlightProviderService,
sw
.
cancelAllStatisticsReplies
();
sw
.
cancelAllStatisticsReplies
();
addUpdateToQueue
(
new
SwitchUpdate
(
sw
.
getId
(),
addUpdateToQueue
(
new
SwitchUpdate
(
sw
.
getId
(),
SwitchUpdateType
.
REMOVED
));
SwitchUpdateType
.
REMOVED
));
notifier
.
postNotification
(
"Switch "
+
sw
.
getStringId
()
+
" disconnected."
);
}
}
/**
/**
...
@@ -1677,7 +1706,6 @@ public class Controller implements IFloodlightProviderService,
...
@@ -1677,7 +1706,6 @@ public class Controller implements IFloodlightProviderService,
"switch=%s, port=%s"
,
sw
,
port
);
"switch=%s, port=%s"
,
sw
,
port
);
throw
new
NullPointerException
(
msg
);
throw
new
NullPointerException
(
msg
);
}
}
this
.
switchManager
.
switchPortsChanged
(
sw
,
port
,
changeType
);
this
.
switchManager
.
switchPortsChanged
(
sw
,
port
,
changeType
);
}
}
...
@@ -2223,6 +2251,8 @@ public class Controller implements IFloodlightProviderService,
...
@@ -2223,6 +2251,8 @@ public class Controller implements IFloodlightProviderService,
ListenerDispatcher
<
OFType
,
ListenerDispatcher
<
OFType
,
IOFMessageListener
>>();
IOFMessageListener
>>();
this
.
switchListeners
=
new
CopyOnWriteArraySet
<
IOFSwitchListener
>();
this
.
switchListeners
=
new
CopyOnWriteArraySet
<
IOFSwitchListener
>();
// add switch notification listener
this
.
addOFSwitchListener
(
new
NotificationSwitchListener
());
this
.
readyForReconcileListeners
=
this
.
readyForReconcileListeners
=
new
CopyOnWriteArraySet
<
IReadyForReconcileListener
>();
new
CopyOnWriteArraySet
<
IReadyForReconcileListener
>();
this
.
haListeners
=
this
.
haListeners
=
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment