forked from openvswitch/ovs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ofproto-dpif: Unhide structure contents.
Until now, ofproto-dpif.c has hidden the definitions of several structures, such as struct ofproto_dpif and struct rule_dpif. This kind of information hiding is often beneficial, because it forces code outside the file with the definition to use the documented interfaces. However, in this case it was starting to burden ofproto-dpif with an increasing number of trivial helpers that were not improving or maintaining a useful abstraction and that were making code harder to maintain and read. Information hiding also made it hard to move blocks of code outside ofproto-dpif.c itself, since any code moved out often needed new helpers if it used anything that wasn't previously exposed. In the present instance, upcoming patches will move code for tracing outside ofproto-dpif, and this would require adding several helpers that would just obscure the function of the code otherwise needlessly. In balance, it seems that there is more harm than good in the information hiding here, so this commit moves the definitions of several structures from ofproto-dpif.c into ofproto-dpif.h. It also removes all of the trivial helpers that had accumulated, instead changing their users to directly access the members that they needed. It also reorganizes ofproto-dpif.h, grouping structure definitions and function prototypes in a sensible way. Signed-off-by: Ben Pfaff <[email protected]> Acked-by: Lance Richardson <[email protected]> Acked-by: Justin Pettit <[email protected]>
- Loading branch information
Showing
7 changed files
with
274 additions
and
458 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.