Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libloc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
libloc
Commits
d698ca09
Commit
d698ca09
authored
Mar 07, 2022
by
Michael Tremer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address: Rename in6_addr_get_bit/in6_addr_set_bit to loc_address_*
Signed-off-by:
Michael Tremer
<
michael.tremer@ipfire.org
>
parent
9c1e2943
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
src/database.c
src/database.c
+3
-3
src/libloc/address.h
src/libloc/address.h
+2
-2
src/network.c
src/network.c
+1
-1
No files found.
src/database.c
View file @
d698ca09
...
...
@@ -809,8 +809,8 @@ static int __loc_database_lookup(struct loc_database* db, const struct in6_addr*
off_t
node_index
;
// Follow the path
int
bit
=
in6_addr
_get_bit
(
address
,
level
);
in6_addr
_set_bit
(
network_address
,
level
,
bit
);
int
bit
=
loc_address
_get_bit
(
address
,
level
);
loc_address
_set_bit
(
network_address
,
level
,
bit
);
if
(
bit
==
0
)
node_index
=
be32toh
(
node
->
zero
);
...
...
@@ -1243,7 +1243,7 @@ static int __loc_database_enumerator_next_network(
}
// Mark the bits on the path correctly
in6_addr
_set_bit
(
&
enumerator
->
network_address
,
loc_address
_set_bit
(
&
enumerator
->
network_address
,
(
node
->
depth
>
0
)
?
node
->
depth
-
1
:
0
,
node
->
i
);
DEBUG
(
enumerator
->
ctx
,
"Looking at node %jd
\n
"
,
(
intmax_t
)
node
->
offset
);
...
...
src/libloc/address.h
View file @
d698ca09
...
...
@@ -45,11 +45,11 @@ static inline int loc_address_cmp(const struct in6_addr* a1, const struct in6_ad
return
0
;
}
static
inline
int
in6_addr
_get_bit
(
const
struct
in6_addr
*
address
,
unsigned
int
i
)
{
static
inline
int
loc_address
_get_bit
(
const
struct
in6_addr
*
address
,
unsigned
int
i
)
{
return
((
address
->
s6_addr
[
i
/
8
]
>>
(
7
-
(
i
%
8
)))
&
1
);
}
static
inline
void
in6_addr
_set_bit
(
struct
in6_addr
*
address
,
unsigned
int
i
,
unsigned
int
val
)
{
static
inline
void
loc_address
_set_bit
(
struct
in6_addr
*
address
,
unsigned
int
i
,
unsigned
int
val
)
{
address
->
s6_addr
[
i
/
8
]
^=
(
-
val
^
address
->
s6_addr
[
i
/
8
])
&
(
1
<<
(
7
-
(
i
%
8
)));
}
...
...
src/network.c
View file @
d698ca09
...
...
@@ -782,7 +782,7 @@ static struct loc_network_tree_node* loc_network_tree_get_path(struct loc_networ
for
(
unsigned
int
i
=
0
;
i
<
prefix
;
i
++
)
{
// Check if the ith bit is one or zero
node
=
loc_network_tree_get_node
(
node
,
in6_addr
_get_bit
(
address
,
i
));
node
=
loc_network_tree_get_node
(
node
,
loc_address
_get_bit
(
address
,
i
));
}
return
node
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment