Skip to content
This repository was archived by the owner on Apr 22, 2024. It is now read-only.

Commit e994b22

Browse files
committed
Fix multiple references warnings using v0x04
This commit will fix sphinx warnings with more than one target found
1 parent d9bc9b1 commit e994b22

22 files changed

Lines changed: 194 additions & 110 deletions

pyof/v0x04/asynchronous/flow_removed.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class FlowRemoved(GenericMessage):
3737
OFPT_FLOW_REMOVED message.
3838
"""
3939

40-
#: :class:`~.header.Header`: OpenFlow Header
40+
#: :class:`~pyof.v0x04.common.header.Header`: OpenFlow Header
4141
header = Header(message_type=Type.OFPT_FLOW_REMOVED)
4242
#: Opaque controller-issued identifier.
4343
cookie = UBInt64()
@@ -58,7 +58,7 @@ class FlowRemoved(GenericMessage):
5858
packet_count = UBInt64()
5959
byte_count = UBInt64()
6060
#: Description of fields. Variable size.
61-
#: :class:`~.common.flow_match.Match`
61+
#: :class:`~pyof.v0x04.common.flow_match.Match`
6262
match = Match()
6363

6464
def __init__(self, xid=None, cookie=None, priority=None, reason=None,
@@ -71,7 +71,8 @@ def __init__(self, xid=None, cookie=None, priority=None, reason=None,
7171
xid (int): OpenFlow Header's xid.
7272
cookie (int): Opaque controller-issued identifier.
7373
priority (int): Priority level of flow entry.
74-
reason (FlowRemovedReason): Why the flow was removed.
74+
reason (~pyof.v0x04.asynchronous.flow_removed.FlowRemovedReason):
75+
Why the flow was removed.
7576
table_id (int): ID of the table.
7677
duration_sec (int): Time the flow was alive in seconds.
7778
duration_nsec (int): Time the flow was alive in nanoseconds in
@@ -80,7 +81,7 @@ def __init__(self, xid=None, cookie=None, priority=None, reason=None,
8081
hard_timeout (int): Hard timeout from original flow mod.
8182
packet_count (int): Number of packets.
8283
byte_count (int): Byte count.
83-
match (Match): Fields' description.
84+
match (~pyof.v0x04.common.flow_match.Match): Fields' description.
8485
"""
8586
super().__init__(xid)
8687
self.cookie = cookie

pyof/v0x04/asynchronous/packet_in.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class PacketInReason(IntEnum):
3434
class PacketIn(GenericMessage):
3535
"""Packet received on port (datapath -> controller)."""
3636

37-
#: :class:`~.header.Header`: OpenFlow Header
37+
#: :class:`~pyof.v0x04.common.header.Header`: OpenFlow Header
3838
header = Header(message_type=Type.OFPT_PACKET_IN)
3939
#: ID assigned by datapath.
4040
buffer_id = UBInt32()
@@ -63,11 +63,12 @@ def __init__(self, xid=None, buffer_id=None, total_len=None, reason=None,
6363
xid (int): Header's xid.
6464
buffer_id (int): ID assigned by datapath.
6565
total_len (int): Full length of frame.
66-
reason (PacketInReason): The reason why the packet is being sent
66+
reason (~pyof.v0x04.asynchronous.packet_in.PacketInReason):
67+
The reason why the packet is being sent
6768
table_id (int): ID of the table that was looked up
6869
cookie (int): Cookie of the flow entry that was looked up
69-
match (:class:`~.common.flow_match.Match`): Packet metadata.
70-
Variable size.
70+
match (:class:`~pyof.v0x04.common.flow_match.Match`):
71+
Packet metadata with variable size.
7172
data (bytes): Ethernet frame, halfway through 32-bit word, so the
7273
IP header is 32-bit aligned. The amount of data is inferred
7374
from the length field in the header. Because of padding,

pyof/v0x04/asynchronous/port_status.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,23 @@ class PortReason(IntEnum):
3131
class PortStatus(GenericMessage):
3232
"""A physical port has changed in the datapath."""
3333

34-
#: :class:`~.header.Header`: OpenFlow Header
34+
#: :class:`~pyof.v0x04.common.action.ActionHeader`: OpenFlow Header
3535
header = Header(message_type=Type.OFPT_PORT_STATUS)
3636
#: One of OFPPR_*.
3737
reason = UBInt8(enum_ref=PortReason)
3838
#: Align to 32-bits.
3939
pad = Pad(7)
40-
#: :class:`~.common.port.Port`
40+
#: :class:`~pyof.v0x04.common.port.Port`
4141
desc = Port()
4242

4343
def __init__(self, xid=None, reason=None, desc=None):
4444
"""Assign parameters to object attributes.
4545
4646
Args:
4747
xid (int): Header's xid.
48-
reason (:class:`~PortReason`): Addition, deletion or modification.
49-
desc (Port): Port description.
48+
reason (~pyof.v0x04.asynchronous.port_status.PortReason):
49+
Addition, deletion or modification.
50+
desc (~pyof.v0x04.common.port.Port): Port description.
5051
"""
5152
super().__init__(xid)
5253
self.reason = reason

pyof/v0x04/common/action.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ def __init__(self, action_type=None, length=None):
138138
"""The following constructor parameters are optional.
139139
140140
Args:
141-
action_type (ActionType): The type of the action.
141+
action_type (~pyof.v0x04.common.action.ActionType):
142+
The type of the action.
142143
length (int): Length of action, including this header.
143144
"""
144145
super().__init__()
@@ -335,6 +336,7 @@ def __init__(self, items=None):
335336
"""The constructor just assings parameters to object attributes.
336337
337338
Args:
338-
items (ActionHeader): Instance or a list of instances.
339+
items (~pyof.v0x04.common.action.ActionHeader):
340+
Instance or a list of instances.
339341
"""
340342
super().__init__(pyof_class=ActionHeader, items=items)

pyof/v0x04/common/flow_instructions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
__all__ = ('InstructionApplyAction', 'InstructionClearAction',
2020
'InstructionGotoTable', 'InstructionMeter', 'InstructionType',
21-
'InstructionWriteAction', 'InstructionWriteMetadata')
21+
'InstructionWriteAction', 'InstructionWriteMetadata',
22+
'ListOfInstruction')
2223

2324
# Enums
2425

pyof/v0x04/common/header.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ def __init__(self, message_type=None, length=None, xid=randint(0, MAXID)):
9494
"""The constructor takes the optional parameters below.
9595
9696
Args:
97-
message_type (Type): One of the OFPT_* constants.
97+
message_type (~pyof.v0x04.common.header.Type):
98+
One of the OFPT_* constants.
9899
length (int): Length including this ofp_header.
99100
xid (int): Transaction id associated with this packet. Replies use
100101
the same id as was in the request to facilitate pairing.

pyof/v0x04/common/port.py

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ class PortNo(IntEnum):
5050
class PortConfig(GenericBitMask):
5151
"""Flags to indicate behavior of the physical port.
5252
53-
These flags are used in :class:`~Port` to describe the current
54-
configuration. They are used in the :class:`~PortMod` message to configure
53+
These flags are used in :class:`Port` to describe the current
54+
configuration. They are used in the
55+
:class:`~pyof.v0x04.controller2switch.port_mod.PortMod`
56+
message to configure
5557
the port's behavior.
5658
5759
The :attr:`OFPPC_PORT_DOWN` bit indicates that the port has been
@@ -206,12 +208,16 @@ def __init__(self, port_no=None, hw_addr=None, name=None, config=None,
206208
port_no (int): Port number.
207209
hw_addr (HWAddress): Hardware address.
208210
name (str): Null-terminated name.
209-
config (PortConfig): Bitmap of OFPPC* flags.
210-
state (PortState): Bitmap of OFPPS* flags.
211-
curr (PortFeatures): Current features.
212-
advertised (PortFeatures): Features being advertised by the port.
213-
supported (PortFeatures): Features supported by the port.
214-
peer (PortFeatures): Features advertised by peer.
211+
config (~pyof.v0x04.common.port.PortConfig):
212+
Bitmap of OFPPC* flags.
213+
state (~pyof.v0x04.common.port.PortState): Bitmap of OFPPS* flags.
214+
curr (~pyof.v0x04.common.port.PortFeatures): Current features.
215+
advertised (~pyof.v0x04.common.port.PortFeatures):
216+
Features being advertised by the port.
217+
supported (~pyof.v0x04.common.port.PortFeatures):
218+
Features supported by the port.
219+
peer (~pyof.v0x04.common.port.PortFeatures):
220+
Features advertised by peer.
215221
curr_speed (int): Current port bitrate in kbps.
216222
max_speed (int): Max port bitrate in kbps.
217223
"""
@@ -233,15 +239,17 @@ class ListOfPorts(FixedTypeList):
233239
"""List of Ports.
234240
235241
Represented by instances of :class:`Port` and used on
236-
:class:`.FeaturesReply`/:class:`.SwitchFeatures` objects.
242+
:class:`~pyof.v0x04.controller2switch.features_reply.FeaturesReply`/
243+
:class:`~pyof.v0x04.controller2switch.features_reply.SwitchFeatures`
244+
objects.
237245
"""
238246

239247
def __init__(self, items=None):
240248
"""The constructor takes the optional parameter below.
241249
242250
Args:
243-
items (:class:`list`, :class:`Port`): One :class:`Port`
244-
instance or list.
251+
items (:class:`list`, :class:`~pyof.v0x04.common.port.Port`):
252+
One :class:`~pyof.v0x04.common.port.Port` instance or list.
245253
"""
246254
super().__init__(pyof_class=Port,
247255
items=items)

pyof/v0x04/common/queue.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def __init__(self, queue_property=None, length=None):
4646
"""The contructor takes the paremeters below.
4747
4848
Args:
49-
queue_property (QueueProperties): The queue property.
49+
queue_property (~pyof.v0x04.common.queue.QueueProperties):
50+
The queue property.
5051
length (int): Length of property, including this header.
5152
"""
5253
super().__init__()
@@ -93,8 +94,8 @@ def __init__(self, queue_id=None, port=None, length=None, properties=None):
9394
queue_id (int): ID of the specific queue.
9495
port (int): Port his queue is attached to.
9596
length (int): Length in bytes of this queue desc.
96-
properties(ListOfProperties): Queue's list of properties. Default
97-
is an empty list.
97+
properties(~pyof.v0x04.common.queue.ListOfProperties):
98+
Queue's list of properties. Default is an empty list.
9899
"""
99100
super().__init__()
100101
self.queue_id = queue_id

pyof/v0x04/common/table_feature.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ def __init__(self, property_type=None):
8989
"""Constructor of Generic Instruction receives the parameters bellow.
9090
9191
Args:
92-
type(TableFeaturePropType): Property Type value of this instance.
92+
type(~pyof.v0x04.controller2switch.common.TableFeaturePropType):
93+
Property Type value of this instance.
9394
"""
9495
super().__init__()
9596
self.property_type = property_type
@@ -144,7 +145,8 @@ def __init__(self, property_type=TableFeaturePropType.OFPTFPT_INSTRUCTIONS,
144145
"""Constructor of InstructionProperty receives the parameters bellow.
145146
146147
Args:
147-
type(TableFeaturePropType): Property Type value of this instance.
148+
type(~pyof.v0x04.controller2switch.common.TableFeaturePropType):
149+
Property Type value of this instance.
148150
instruction_ids(ListOfInstruction): List of Instruction instances.
149151
"""
150152
super().__init__(property_type=property_type)
@@ -167,7 +169,8 @@ def __init__(self, property_type=TableFeaturePropType.OFPTFPT_NEXT_TABLES,
167169
"""Constructor of NextTablesProperty receives the parameters bellow.
168170
169171
Args:
170-
type(TableFeaturePropType): Property Type value of this instance.
172+
type(~pyof.v0x04.controller2switch.common.TableFeaturePropType):
173+
Property Type value of this instance.
171174
next_table_ids(ListOfInstruction): List of InstructionGotoTable
172175
instances.
173176
"""
@@ -194,7 +197,8 @@ def __init__(self,
194197
"""Constructor of ActionsProperty receives the parameters bellow.
195198
196199
Args:
197-
type(TableFeaturePropType): Property Type value of this instance.
200+
type(~pyof.v0x04.controller2switch.common.TableFeaturePr):
201+
Property Type value of this instance.
198202
action_ids(ListOfActions): List of Action instances.
199203
"""
200204
super().__init__(property_type)
@@ -221,8 +225,10 @@ def __init__(self, property_type=TableFeaturePropType.OFPTFPT_MATCH,
221225
"""Constructor of OxmProperty receives the parameters bellow.
222226
223227
Args:
224-
type(TableFeaturePropType): Property Type value of this instance.
225-
oxm_ids(ListOfOxmHeader): List of OxmHeader instances.
228+
type(~pyof.v0x04.controller2switch.common.TableFeaturePropType):
229+
Property Type value of this instance.
230+
oxm_ids(~pyof.v0x04.common.flow_match.ListOfOxmHeader):
231+
List of OxmHeader instances.
226232
"""
227233
super().__init__(property_type)
228234
self.oxm_ids = oxm_ids
@@ -239,7 +245,8 @@ def __init__(self, items=None):
239245
"""The constructor just assings parameters to object attributes.
240246
241247
Args:
242-
items (Property): Instance or a list of instances.
248+
items (~pyof.v0x04.controller2switch.common.Property):
249+
Instance or a list of instances.
243250
"""
244251
super().__init__(pyof_class=Property, items=items)
245252

@@ -293,7 +300,8 @@ def __init__(self, table_id=Table.OFPTT_ALL, name="",
293300
config(int): Field reseved for future use.
294301
max_entries(int): Describe the maximum number of flow entries
295302
that can be inserted into that table.
296-
properties(ListOfProperty): List of Property intances.
303+
properties(~pyof.v0x04.controller2switch.common.Property):
304+
List of Property intances.
297305
"""
298306
super().__init__()
299307
self.table_id = table_id

pyof/v0x04/common/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def new_message_from_header(header):
134134
"""Given an OF Header, return an empty message of header's message_type.
135135
136136
Args:
137-
header (Header): Unpacked OpenFlow Header.
137+
header (~pyof.v0x04.common.header.Header): Unpacked OpenFlow Header.
138138
139139
Returns:
140140
Empty OpenFlow message of the same type of message_type attribute from

0 commit comments

Comments
 (0)