Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ethmngr
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HAL
ethmngr
Commits
171cf63d
Verified
Commit
171cf63d
authored
4 months ago
by
Vivek Dutta
Browse files
Options
Downloads
Patches
Plain Diff
Removed hotplug.ethernet call on network.device event
parent
9c245d2c
Branches
Branches containing commit
No related tags found
1 merge request
!31
Removed hotplug.ethernet call on network.device event
Pipeline
#201063
failed
3 months ago
Stage: static_code_analysis
Stage: functional_test
Changes
2
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ethmngr.c
+0
-56
0 additions, 56 deletions
src/ethmngr.c
src/helper.c
+0
-41
0 additions, 41 deletions
src/helper.c
with
0 additions
and
97 deletions
src/ethmngr.c
+
0
−
56
View file @
171cf63d
...
@@ -25,59 +25,6 @@
...
@@ -25,59 +25,6 @@
struct
bbfdm_context
bbfdm_ctx
=
{
0
};
struct
bbfdm_context
bbfdm_ctx
=
{
0
};
static
void
eth_port_handler_cb
(
struct
ubus_context
*
ctx
,
struct
ubus_event_handler
*
ev
__attribute__
((
unused
)),
const
char
*
type
,
struct
blob_attr
*
msg
)
{
if
(
DM_STRCMP
(
type
,
"network.device"
)
!=
0
)
return
;
enum
{
NET_DEV_POLICY_IFNAME
,
NET_DEV_POLICY_LINK
,
_MAX_NET_DEV_POLICY
};
struct
blobmsg_policy
net_dev_policy
[
_MAX_NET_DEV_POLICY
]
=
{
[
NET_DEV_POLICY_IFNAME
]
=
{
.
name
=
"ifname"
,
.
type
=
BLOBMSG_TYPE_STRING
},
[
NET_DEV_POLICY_LINK
]
=
{
.
name
=
"link"
,
.
type
=
BLOBMSG_TYPE_STRING
},
};
struct
blob_attr
*
tb
[
_MAX_NET_DEV_POLICY
];
char
ifname
[
32
]
=
{
0
};
char
link
[
32
]
=
{
0
};
blobmsg_parse
(
net_dev_policy
,
_MAX_NET_DEV_POLICY
,
tb
,
blobmsg_data
(
msg
),
blobmsg_len
(
msg
));
if
(
!
tb
[
NET_DEV_POLICY_IFNAME
])
{
BBF_ERR
(
"
\"
ifname
\"
not found in network.device event!"
);
return
;
}
if
(
!
tb
[
NET_DEV_POLICY_LINK
])
{
BBF_ERR
(
"
\"
link
\"
not found in network.device event!"
);
return
;
}
snprintf
(
ifname
,
sizeof
(
ifname
),
"%s"
,
blobmsg_get_string
(
tb
[
NET_DEV_POLICY_IFNAME
]));
snprintf
(
link
,
sizeof
(
link
),
"%s"
,
blobmsg_get_string
(
tb
[
NET_DEV_POLICY_LINK
]));
invoke_ethernet_hotplug
(
ctx
,
ifname
,
link
);
}
static
int
register_ethernet_event
(
struct
ubus_context
*
ctx
)
{
int
ret
;
struct
ubus_event_handler
ev
=
{
0
};
memset
(
&
ev
,
0
,
sizeof
(
struct
ubus_event_handler
));
ev
.
cb
=
eth_port_handler_cb
;
ret
=
ubus_register_event_handler
(
ctx
,
&
ev
,
"network.device"
);
return
ret
;
}
#ifdef ETHMNGR_EXPOSE_ETHERNET_OBJECT
#ifdef ETHMNGR_EXPOSE_ETHERNET_OBJECT
/* ifstats policy */
/* ifstats policy */
enum
{
enum
{
...
@@ -344,9 +291,6 @@ int main(int argc, char **argv)
...
@@ -344,9 +291,6 @@ int main(int argc, char **argv)
goto
out
;
goto
out
;
#endif
#endif
if
(
register_ethernet_event
(
&
bbfdm_ctx
.
ubus_ctx
)
!=
0
)
goto
out
;
uloop_run
();
uloop_run
();
out:
out:
bbfdm_ubus_regiter_free
(
&
bbfdm_ctx
);
bbfdm_ubus_regiter_free
(
&
bbfdm_ctx
);
...
...
This diff is collapsed.
Click to expand it.
src/helper.c
+
0
−
41
View file @
171cf63d
...
@@ -15,47 +15,6 @@
...
@@ -15,47 +15,6 @@
#include
"helper.h"
#include
"helper.h"
static
void
ubus_call
(
struct
ubus_context
*
ctx
,
const
char
*
obj
,
const
char
*
method
,
struct
blob_attr
*
msg
,
ubus_data_handler_t
cb
,
void
*
value
)
{
uint32_t
id
;
if
(
ctx
==
NULL
||
obj
==
NULL
)
return
;
if
(
!
ubus_lookup_id
(
ctx
,
obj
,
&
id
))
{
ubus_invoke
(
ctx
,
id
,
method
,
msg
,
cb
,
value
,
5000
);
}
}
void
invoke_ethernet_hotplug
(
struct
ubus_context
*
ctx
,
char
*
ifname
,
char
*
link
)
{
if
(
ctx
==
NULL
||
ifname
==
NULL
||
link
==
NULL
)
return
;
if
(
strlen
(
ifname
)
==
0
||
strlen
(
link
)
==
0
)
return
;
char
env_port
[
56
]
=
{
0
};
char
env_link
[
56
]
=
{
0
};
struct
blob_buf
b
=
{
0
};
snprintf
(
env_port
,
sizeof
(
env_port
),
"PORT=%s"
,
ifname
);
snprintf
(
env_link
,
sizeof
(
env_link
),
"LINK=%s"
,
link
);
memset
(
&
b
,
0
,
sizeof
(
struct
blob_buf
));
blob_buf_init
(
&
b
,
0
);
void
*
arr
=
blobmsg_open_array
(
&
b
,
"env"
);
blobmsg_add_string
(
&
b
,
NULL
,
env_port
);
blobmsg_add_string
(
&
b
,
NULL
,
env_link
);
blobmsg_close_array
(
&
b
,
arr
);
ubus_call
(
ctx
,
"hotplug.ethernet"
,
"call"
,
b
.
head
,
NULL
,
NULL
);
blob_buf_free
(
&
b
);
}
int
ethmngr_clear_stats
(
char
*
ifname
)
int
ethmngr_clear_stats
(
char
*
ifname
)
{
{
if
(
ifname
==
NULL
)
if
(
ifname
==
NULL
)
...
...
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