verinec.importer.analysis.sniffer
Class StartSniffer.ConfigPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by verinec.importer.analysis.sniffer.StartSniffer.ConfigPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, IConfigPanel
Enclosing class:
StartSniffer

public static class StartSniffer.ConfigPanel
extends JPanel
implements IConfigPanel

Configuration for the sniffer. Provides method to access configured settings.

Author:
david.buchmann at unifr.ch
See Also:
Serialized Form

Nested Class Summary
 class StartSniffer.ConfigPanel.ConfigCard
          Base class for configuration cards.
 class StartSniffer.ConfigPanel.DeviceConfigCard
          Configuration card for individual interface.
 class StartSniffer.ConfigPanel.GlobalConfigCard
          Configuration card for global config.
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  JPanel cards
           
private static String[] hours
           
protected  Logger logger
          A logger for debug.
private static String[] min
           
static int NONE
          Modus "no modus"
static int PACKETS
          Modus: Count packets
(package private)  AnalysisConfigPanel panel
           
private static String[] sec
           
static int SIMULATE
          Modus: Simulate.
static int SIMULATION_PACKET_COUNT
          Number of packets to capture in simulation mode.
protected  boolean sufficientRights
          Whether we can open interfaces in promiscious mode.
static int TIME
          Modus: Time limitation
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
StartSniffer.ConfigPanel(AnalysisConfigPanel parent)
          Create the config panel for the sniffer part of network analysis.
 
Method Summary
protected  void bringToFront(String cardname)
          Select network card to configure.
 StartSniffer.ConfigPanel.DeviceConfigCard[] getActiveDevices()
          Get the device configurations for the devices that are enabled.
private  jpcap.NetworkInterface[] getAvailableDevices()
          This method finds out the available network interfaces
 Element getConfigurationXML()
          Get the xml element for the sniffer configuration.
 StartSniffer.ConfigPanel.GlobalConfigCard getGlobals()
          Get the global configuration for sniffing.
 boolean isConfigValid()
          Check whether configuration is valid.
 void restore(Element e)
          Restore settings using the config as returned by getConfigurationXML().
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PACKETS

public static final int PACKETS
Modus: Count packets

See Also:
Constant Field Values

TIME

public static final int TIME
Modus: Time limitation

See Also:
Constant Field Values

SIMULATE

public static final int SIMULATE
Modus: Simulate.

See Also:
Constant Field Values

NONE

public static final int NONE
Modus "no modus"

See Also:
Constant Field Values

SIMULATION_PACKET_COUNT

public static final int SIMULATION_PACKET_COUNT
Number of packets to capture in simulation mode.

See Also:
Constant Field Values

panel

AnalysisConfigPanel panel

logger

protected Logger logger
A logger for debug.


sufficientRights

protected boolean sufficientRights
Whether we can open interfaces in promiscious mode.


cards

private JPanel cards

min

private static String[] min

sec

private static String[] sec

hours

private static String[] hours
Constructor Detail

StartSniffer.ConfigPanel

public StartSniffer.ConfigPanel(AnalysisConfigPanel parent)
                         throws VerinecException
Create the config panel for the sniffer part of network analysis.

Parameters:
parent - The dialog this panel will be child of.
Throws:
VerinecException - when anything goes wrong.
Method Detail

bringToFront

protected void bringToFront(String cardname)
Select network card to configure.

Parameters:
cardname - Name of the card to configure.

isConfigValid

public boolean isConfigValid()
Check whether configuration is valid.

Specified by:
isConfigValid in interface IConfigPanel
Returns:
True if configuration is valid, false otherwise.

getGlobals

public StartSniffer.ConfigPanel.GlobalConfigCard getGlobals()
Get the global configuration for sniffing.

Returns:
The global configuration container.

getActiveDevices

public StartSniffer.ConfigPanel.DeviceConfigCard[] getActiveDevices()
Get the device configurations for the devices that are enabled.

Returns:
List of devices to sniff on.

getConfigurationXML

public Element getConfigurationXML()
Get the xml element for the sniffer configuration.

Specified by:
getConfigurationXML in interface IConfigPanel
Returns:
An XML element storing the configuration for sniffing.

restore

public void restore(Element e)
Restore settings using the config as returned by getConfigurationXML().

Specified by:
restore in interface IConfigPanel
Parameters:
e - The configuration parent.

getAvailableDevices

private jpcap.NetworkInterface[] getAvailableDevices()
                                              throws VerinecException
This method finds out the available network interfaces

Returns:
The names of available devices.
Throws:
VerinecException - is throwed when no libpcap is found.

Copyright © 2005 Verinec, DIUF