Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
System Manager
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
system
System Manager
Commits
300cca57
Verified
Commit
300cca57
authored
7 months ago
by
Suvendhu Hansa
Committed by
IOPSYS Dev
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Datamodel Vendor extensions for FD and ActiveConnections
parent
93dfeb49
Branches
Branches containing commit
No related tags found
1 merge request
!19
Moved vendor ext from gnx_bbf_ext
Pipeline
#189675
passed
7 months ago
Stage: static_code_analysis
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/Makefile
+3
-0
3 additions, 0 deletions
src/Makefile
src/deviceinfo.c
+38
-1
38 additions, 1 deletion
src/deviceinfo.c
src/network.c
+32
-0
32 additions, 0 deletions
src/network.c
with
73 additions
and
1 deletion
src/Makefile
+
3
−
0
View file @
300cca57
...
...
@@ -39,6 +39,9 @@ endif
ifeq
($(SYSMNGR_VENDOR_EXTENSIONS),y)
PROG_CFLAGS
+=
-DSYSMNGR_VENDOR_EXTENSIONS
ifndef
CUSTOM_PREFIX
PROG_CFLAGS
+=
-DCUSTOM_PREFIX
=
\"
X_IOPSYS_EU_
\"
endif
endif
ifneq
($(filter y,$(SYSMNGR_FIRMWARE_IMAGE) $(SYSMNGR_FWBANK_UBUS_SUPPORT)),)
...
...
This diff is collapsed.
Click to expand it.
src/deviceinfo.c
+
38
−
1
View file @
300cca57
...
...
@@ -226,11 +226,44 @@ static int get_deviceinfo_base_mac_addr(char *refparam, struct dmctx *ctx, void
db_get_value_string
(
"device"
,
"deviceinfo"
,
"BaseMACAddress"
,
value
);
return
0
;
}
static
int
get_DeviceInfoFileDescriptors_Used
(
char
*
refparam
,
struct
dmctx
*
ctx
,
void
*
data
,
char
*
instance
,
char
**
value
)
{
char
val
[
32
]
=
{
'\0'
};
dm_read_sysfs_file
(
"/proc/sys/fs/file-nr"
,
val
,
sizeof
(
val
));
if
(
'\0'
==
val
[
0
])
{
*
value
=
dmstrdup
(
"-1"
);
}
else
{
*
value
=
dmstrdup
(
val
);
}
return
0
;
}
static
int
get_DeviceInfoFileDescriptors_MaxAllowed
(
char
*
refparam
,
struct
dmctx
*
ctx
,
void
*
data
,
char
*
instance
,
char
**
value
)
{
char
val
[
32
]
=
{
'\0'
};
dm_read_sysfs_file
(
"/proc/sys/fs/file-max"
,
val
,
sizeof
(
val
));
if
(
'\0'
==
val
[
0
])
{
*
value
=
dmstrdup
(
"-1"
);
}
else
{
*
value
=
dmstrdup
(
val
);
}
return
0
;
}
#endif
/**********************************************************************************************************************************
* OBJ & LEAF DEFINITION
***********************************************************************************************************************************/
#ifdef SYSMNGR_VENDOR_EXTENSIONS
DMLEAF
tDeviceInfoFileDescriptorsParams
[]
=
{
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{
"Used"
,
&
DMREAD
,
DMT_INT
,
get_DeviceInfoFileDescriptors_Used
,
NULL
,
BBFDM_BOTH
},
{
"MaxAllowed"
,
&
DMREAD
,
DMT_INT
,
get_DeviceInfoFileDescriptors_MaxAllowed
,
NULL
,
BBFDM_BOTH
},
{
0
}
};
#endif
/* *** Device.DeviceInfo. *** */
DMOBJ
tDeviceInfoObj
[]
=
{
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type*/
...
...
@@ -266,6 +299,10 @@ DMOBJ tDeviceInfoObj[] = {
{
"TemperatureStatus"
,
&
DMREAD
,
NULL
,
NULL
,
"file:/etc/sysmngr/temperature.sh"
,
NULL
,
NULL
,
NULL
,
tDeviceInfoTemperatureStatusObj
,
tDeviceInfoTemperatureStatusParams
,
NULL
,
BBFDM_BOTH
},
#endif
#ifdef SYSMNGR_VENDOR_EXTENSIONS
{
CUSTOM_PREFIX
"FileDescriptors"
,
&
DMREAD
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
tDeviceInfoFileDescriptorsParams
,
NULL
,
BBFDM_BOTH
},
#endif
{
0
}
};
...
...
@@ -307,7 +344,7 @@ DMLEAF tDeviceInfoParams[] = {
#endif
#ifdef SYSMNGR_VENDOR_EXTENSIONS
{
BBF_VENDOR
_PREFIX
"BaseMACAddress"
,
&
DMREAD
,
DMT_STRING
,
get_deviceinfo_base_mac_addr
,
NULL
,
BBFDM_BOTH
},
{
CUSTOM
_PREFIX
"BaseMACAddress"
,
&
DMREAD
,
DMT_STRING
,
get_deviceinfo_base_mac_addr
,
NULL
,
BBFDM_BOTH
},
#endif
{
0
}
...
...
This diff is collapsed.
Click to expand it.
src/network.c
+
32
−
0
View file @
300cca57
...
...
@@ -106,6 +106,32 @@ static int get_DeviceInfoNetworkProperties_TCPImplementation(char *refparam, str
return
0
;
}
#ifdef SYSMNGR_VENDOR_EXTENSIONS
static
int
get_Connections_MaxConnections
(
char
*
refparam
,
struct
dmctx
*
ctx
,
void
*
data
,
char
*
instance
,
char
**
value
)
{
char
val
[
32
]
=
{
'\0'
};
dm_read_sysfs_file
(
"/proc/sys/net/netfilter/nf_conntrack_max"
,
val
,
sizeof
(
val
));
if
(
'\0'
==
val
[
0
])
{
*
value
=
dmstrdup
(
"-1"
);
}
else
{
*
value
=
dmstrdup
(
val
);
}
return
0
;
}
static
int
get_Connections_ActiveConnections
(
char
*
refparam
,
struct
dmctx
*
ctx
,
void
*
data
,
char
*
instance
,
char
**
value
)
{
char
val
[
32
]
=
{
'\0'
};
dm_read_sysfs_file
(
"/proc/sys/net/netfilter/nf_conntrack_count"
,
val
,
sizeof
(
val
));
if
(
'\0'
==
val
[
0
])
{
*
value
=
dmstrdup
(
"-1"
);
}
else
{
*
value
=
dmstrdup
(
val
);
}
return
0
;
}
#endif
/**********************************************************************************************************************************
* OBJ & LEAF DEFINITION
***********************************************************************************************************************************/
...
...
@@ -114,5 +140,11 @@ DMLEAF tDeviceInfoNetworkPropertiesParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type */
{
"MaxTCPWindowSize"
,
&
DMREAD
,
DMT_UNINT
,
get_DeviceInfoNetworkProperties_MaxTCPWindowSize
,
NULL
,
BBFDM_BOTH
},
{
"TCPImplementation"
,
&
DMREAD
,
DMT_STRING
,
get_DeviceInfoNetworkProperties_TCPImplementation
,
NULL
,
BBFDM_BOTH
},
#ifdef SYSMNGR_VENDOR_EXTENSIONS
{
CUSTOM_PREFIX
"MaxConnections"
,
&
DMREAD
,
DMT_INT
,
get_Connections_MaxConnections
,
NULL
,
BBFDM_BOTH
},
{
CUSTOM_PREFIX
"ActiveConnections"
,
&
DMREAD
,
DMT_INT
,
get_Connections_ActiveConnections
,
NULL
,
BBFDM_BOTH
},
#endif
{
0
}
};
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