id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
42,700 | rauenzi/discordbot.py | discordbot/cogs/botadmin.py | BotAdmin.unignore | async def unignore(self, ctx, *channels: discord.Channel):
"""Unignores channels from being processed.
If no channels are specified, it unignores the current channel.
To use this command you must have the Manage Channels permission or have the
Bot Admin role.
"""
if le... | python | async def unignore(self, ctx, *channels: discord.Channel):
"""Unignores channels from being processed.
If no channels are specified, it unignores the current channel.
To use this command you must have the Manage Channels permission or have the
Bot Admin role.
"""
if le... | [
"async",
"def",
"unignore",
"(",
"self",
",",
"ctx",
",",
"*",
"channels",
":",
"discord",
".",
"Channel",
")",
":",
"if",
"len",
"(",
"channels",
")",
"==",
"0",
":",
"channels",
"=",
"(",
"ctx",
".",
"message",
".",
"channel",
",",
")",
"# a set ... | Unignores channels from being processed.
If no channels are specified, it unignores the current channel.
To use this command you must have the Manage Channels permission or have the
Bot Admin role. | [
"Unignores",
"channels",
"from",
"being",
"processed",
"."
] | 39bb98dae4e49487e6c6c597f85fc41c74b62bb8 | https://github.com/rauenzi/discordbot.py/blob/39bb98dae4e49487e6c6c597f85fc41c74b62bb8/discordbot/cogs/botadmin.py#L268-L293 |
42,701 | rauenzi/discordbot.py | discordbot/cogs/botadmin.py | BotAdmin.unignore_all | async def unignore_all(self, ctx):
"""Unignores all channels in this server from being processed.
To use this command you must have the Manage Channels permission or have the
Bot Admin role.
"""
channels = [c for c in ctx.message.server.channels if c.type is discord.ChannelType.... | python | async def unignore_all(self, ctx):
"""Unignores all channels in this server from being processed.
To use this command you must have the Manage Channels permission or have the
Bot Admin role.
"""
channels = [c for c in ctx.message.server.channels if c.type is discord.ChannelType.... | [
"async",
"def",
"unignore_all",
"(",
"self",
",",
"ctx",
")",
":",
"channels",
"=",
"[",
"c",
"for",
"c",
"in",
"ctx",
".",
"message",
".",
"server",
".",
"channels",
"if",
"c",
".",
"type",
"is",
"discord",
".",
"ChannelType",
".",
"text",
"]",
"a... | Unignores all channels in this server from being processed.
To use this command you must have the Manage Channels permission or have the
Bot Admin role. | [
"Unignores",
"all",
"channels",
"in",
"this",
"server",
"from",
"being",
"processed",
"."
] | 39bb98dae4e49487e6c6c597f85fc41c74b62bb8 | https://github.com/rauenzi/discordbot.py/blob/39bb98dae4e49487e6c6c597f85fc41c74b62bb8/discordbot/cogs/botadmin.py#L297-L304 |
42,702 | rauenzi/discordbot.py | discordbot/cogs/botadmin.py | BotAdmin.cleanup | async def cleanup(self, ctx, search : int = 100):
"""Cleans up the bot's messages from the channel.
If a search number is specified, it searches that many messages to delete.
If the bot has Manage Messages permissions, then it will try to delete
messages that look like they invoked the ... | python | async def cleanup(self, ctx, search : int = 100):
"""Cleans up the bot's messages from the channel.
If a search number is specified, it searches that many messages to delete.
If the bot has Manage Messages permissions, then it will try to delete
messages that look like they invoked the ... | [
"async",
"def",
"cleanup",
"(",
"self",
",",
"ctx",
",",
"search",
":",
"int",
"=",
"100",
")",
":",
"spammers",
"=",
"Counter",
"(",
")",
"channel",
"=",
"ctx",
".",
"message",
".",
"channel",
"prefixes",
"=",
"self",
".",
"bot",
".",
"command_prefi... | Cleans up the bot's messages from the channel.
If a search number is specified, it searches that many messages to delete.
If the bot has Manage Messages permissions, then it will try to delete
messages that look like they invoked the bot as well.
After the cleanup is completed, the bot... | [
"Cleans",
"up",
"the",
"bot",
"s",
"messages",
"from",
"the",
"channel",
"."
] | 39bb98dae4e49487e6c6c597f85fc41c74b62bb8 | https://github.com/rauenzi/discordbot.py/blob/39bb98dae4e49487e6c6c597f85fc41c74b62bb8/discordbot/cogs/botadmin.py#L308-L368 |
42,703 | rauenzi/discordbot.py | discordbot/cogs/botadmin.py | BotAdmin.plonk | async def plonk(self, ctx, *, member: discord.Member):
"""Bans a user from using the bot.
This bans a person from using the bot in the current server.
There is no concept of a global ban. This ban can be bypassed
by having the Manage Server permission.
To use this command you m... | python | async def plonk(self, ctx, *, member: discord.Member):
"""Bans a user from using the bot.
This bans a person from using the bot in the current server.
There is no concept of a global ban. This ban can be bypassed
by having the Manage Server permission.
To use this command you m... | [
"async",
"def",
"plonk",
"(",
"self",
",",
"ctx",
",",
"*",
",",
"member",
":",
"discord",
".",
"Member",
")",
":",
"plonks",
"=",
"self",
".",
"config",
".",
"get",
"(",
"'plonks'",
",",
"{",
"}",
")",
"guild_id",
"=",
"ctx",
".",
"message",
"."... | Bans a user from using the bot.
This bans a person from using the bot in the current server.
There is no concept of a global ban. This ban can be bypassed
by having the Manage Server permission.
To use this command you must have the Manage Server permission
or have a Bot Admin ... | [
"Bans",
"a",
"user",
"from",
"using",
"the",
"bot",
"."
] | 39bb98dae4e49487e6c6c597f85fc41c74b62bb8 | https://github.com/rauenzi/discordbot.py/blob/39bb98dae4e49487e6c6c597f85fc41c74b62bb8/discordbot/cogs/botadmin.py#L372-L394 |
42,704 | rauenzi/discordbot.py | discordbot/cogs/botadmin.py | BotAdmin.plonks | async def plonks(self, ctx):
"""Shows members banned from the bot."""
plonks = self.config.get('plonks', {})
guild = ctx.message.server
db = plonks.get(guild.id, [])
members = '\n'.join(map(str, filter(None, map(guild.get_member, db))))
if members:
await self.... | python | async def plonks(self, ctx):
"""Shows members banned from the bot."""
plonks = self.config.get('plonks', {})
guild = ctx.message.server
db = plonks.get(guild.id, [])
members = '\n'.join(map(str, filter(None, map(guild.get_member, db))))
if members:
await self.... | [
"async",
"def",
"plonks",
"(",
"self",
",",
"ctx",
")",
":",
"plonks",
"=",
"self",
".",
"config",
".",
"get",
"(",
"'plonks'",
",",
"{",
"}",
")",
"guild",
"=",
"ctx",
".",
"message",
".",
"server",
"db",
"=",
"plonks",
".",
"get",
"(",
"guild",... | Shows members banned from the bot. | [
"Shows",
"members",
"banned",
"from",
"the",
"bot",
"."
] | 39bb98dae4e49487e6c6c597f85fc41c74b62bb8 | https://github.com/rauenzi/discordbot.py/blob/39bb98dae4e49487e6c6c597f85fc41c74b62bb8/discordbot/cogs/botadmin.py#L398-L407 |
42,705 | rauenzi/discordbot.py | discordbot/cogs/botadmin.py | BotAdmin.unplonk | async def unplonk(self, ctx, *, member: discord.Member):
"""Unbans a user from using the bot.
To use this command you must have the Manage Server permission
or have a Bot Admin role.
"""
plonks = self.config.get('plonks', {})
guild_id = ctx.message.server.id
db ... | python | async def unplonk(self, ctx, *, member: discord.Member):
"""Unbans a user from using the bot.
To use this command you must have the Manage Server permission
or have a Bot Admin role.
"""
plonks = self.config.get('plonks', {})
guild_id = ctx.message.server.id
db ... | [
"async",
"def",
"unplonk",
"(",
"self",
",",
"ctx",
",",
"*",
",",
"member",
":",
"discord",
".",
"Member",
")",
":",
"plonks",
"=",
"self",
".",
"config",
".",
"get",
"(",
"'plonks'",
",",
"{",
"}",
")",
"guild_id",
"=",
"ctx",
".",
"message",
"... | Unbans a user from using the bot.
To use this command you must have the Manage Server permission
or have a Bot Admin role. | [
"Unbans",
"a",
"user",
"from",
"using",
"the",
"bot",
"."
] | 39bb98dae4e49487e6c6c597f85fc41c74b62bb8 | https://github.com/rauenzi/discordbot.py/blob/39bb98dae4e49487e6c6c597f85fc41c74b62bb8/discordbot/cogs/botadmin.py#L411-L429 |
42,706 | rauenzi/discordbot.py | discordbot/cogs/meta.py | Meta.join | async def join(self, ctx):
"""Sends you the bot invite link."""
perms = discord.Permissions.none()
perms.read_messages = True
perms.send_messages = True
perms.manage_messages = True
perms.embed_links = True
perms.read_message_history = True
perms.attach_fi... | python | async def join(self, ctx):
"""Sends you the bot invite link."""
perms = discord.Permissions.none()
perms.read_messages = True
perms.send_messages = True
perms.manage_messages = True
perms.embed_links = True
perms.read_message_history = True
perms.attach_fi... | [
"async",
"def",
"join",
"(",
"self",
",",
"ctx",
")",
":",
"perms",
"=",
"discord",
".",
"Permissions",
".",
"none",
"(",
")",
"perms",
".",
"read_messages",
"=",
"True",
"perms",
".",
"send_messages",
"=",
"True",
"perms",
".",
"manage_messages",
"=",
... | Sends you the bot invite link. | [
"Sends",
"you",
"the",
"bot",
"invite",
"link",
"."
] | 39bb98dae4e49487e6c6c597f85fc41c74b62bb8 | https://github.com/rauenzi/discordbot.py/blob/39bb98dae4e49487e6c6c597f85fc41c74b62bb8/discordbot/cogs/meta.py#L31-L41 |
42,707 | rauenzi/discordbot.py | discordbot/cogs/meta.py | Meta.info | async def info(self, ctx, *, member : discord.Member = None):
"""Shows info about a member.
This cannot be used in private messages. If you don't specify
a member then the info returned will be yours.
"""
channel = ctx.message.channel
if member is None:
membe... | python | async def info(self, ctx, *, member : discord.Member = None):
"""Shows info about a member.
This cannot be used in private messages. If you don't specify
a member then the info returned will be yours.
"""
channel = ctx.message.channel
if member is None:
membe... | [
"async",
"def",
"info",
"(",
"self",
",",
"ctx",
",",
"*",
",",
"member",
":",
"discord",
".",
"Member",
"=",
"None",
")",
":",
"channel",
"=",
"ctx",
".",
"message",
".",
"channel",
"if",
"member",
"is",
"None",
":",
"member",
"=",
"ctx",
".",
"... | Shows info about a member.
This cannot be used in private messages. If you don't specify
a member then the info returned will be yours. | [
"Shows",
"info",
"about",
"a",
"member",
"."
] | 39bb98dae4e49487e6c6c597f85fc41c74b62bb8 | https://github.com/rauenzi/discordbot.py/blob/39bb98dae4e49487e6c6c597f85fc41c74b62bb8/discordbot/cogs/meta.py#L44-L77 |
42,708 | rauenzi/discordbot.py | discordbot/bot_utils/config.py | Config.put | async def put(self, key, value, *args):
"""Edits a data entry."""
self._db[key] = value
await self.save() | python | async def put(self, key, value, *args):
"""Edits a data entry."""
self._db[key] = value
await self.save() | [
"async",
"def",
"put",
"(",
"self",
",",
"key",
",",
"value",
",",
"*",
"args",
")",
":",
"self",
".",
"_db",
"[",
"key",
"]",
"=",
"value",
"await",
"self",
".",
"save",
"(",
")"
] | Edits a data entry. | [
"Edits",
"a",
"data",
"entry",
"."
] | 39bb98dae4e49487e6c6c597f85fc41c74b62bb8 | https://github.com/rauenzi/discordbot.py/blob/39bb98dae4e49487e6c6c597f85fc41c74b62bb8/discordbot/bot_utils/config.py#L52-L55 |
42,709 | rauenzi/discordbot.py | discordbot/cogs/reactions.py | Reactions.addreaction | async def addreaction(self, ctx, *, reactor=""):
"""Interactively adds a custom reaction"""
if not reactor:
await self.bot.say("What should I react to?")
response = await self.bot.wait_for_message(author=ctx.message.author)
reactor = response.content
data = s... | python | async def addreaction(self, ctx, *, reactor=""):
"""Interactively adds a custom reaction"""
if not reactor:
await self.bot.say("What should I react to?")
response = await self.bot.wait_for_message(author=ctx.message.author)
reactor = response.content
data = s... | [
"async",
"def",
"addreaction",
"(",
"self",
",",
"ctx",
",",
"*",
",",
"reactor",
"=",
"\"\"",
")",
":",
"if",
"not",
"reactor",
":",
"await",
"self",
".",
"bot",
".",
"say",
"(",
"\"What should I react to?\"",
")",
"response",
"=",
"await",
"self",
".... | Interactively adds a custom reaction | [
"Interactively",
"adds",
"a",
"custom",
"reaction"
] | 39bb98dae4e49487e6c6c597f85fc41c74b62bb8 | https://github.com/rauenzi/discordbot.py/blob/39bb98dae4e49487e6c6c597f85fc41c74b62bb8/discordbot/cogs/reactions.py#L52-L91 |
42,710 | rauenzi/discordbot.py | discordbot/cogs/reactions.py | Reactions.listreactions | async def listreactions(self, ctx):
"""Lists all the reactions for the server"""
data = self.config.get(ctx.message.server.id, {})
if not data:
await self.bot.responses.failure(message="There are no reactions on this server.")
return
try:
pager = Pages... | python | async def listreactions(self, ctx):
"""Lists all the reactions for the server"""
data = self.config.get(ctx.message.server.id, {})
if not data:
await self.bot.responses.failure(message="There are no reactions on this server.")
return
try:
pager = Pages... | [
"async",
"def",
"listreactions",
"(",
"self",
",",
"ctx",
")",
":",
"data",
"=",
"self",
".",
"config",
".",
"get",
"(",
"ctx",
".",
"message",
".",
"server",
".",
"id",
",",
"{",
"}",
")",
"if",
"not",
"data",
":",
"await",
"self",
".",
"bot",
... | Lists all the reactions for the server | [
"Lists",
"all",
"the",
"reactions",
"for",
"the",
"server"
] | 39bb98dae4e49487e6c6c597f85fc41c74b62bb8 | https://github.com/rauenzi/discordbot.py/blob/39bb98dae4e49487e6c6c597f85fc41c74b62bb8/discordbot/cogs/reactions.py#L95-L108 |
42,711 | rauenzi/discordbot.py | discordbot/cogs/reactions.py | Reactions.viewreaction | async def viewreaction(self, ctx, *, reactor : str):
"""Views a specific reaction"""
data = self.config.get(ctx.message.server.id, {})
keyword = data.get(reactor, {})
if not keyword:
await self.bot.responses.failure(message="Reaction '{}' was not found.".format(reactor))
... | python | async def viewreaction(self, ctx, *, reactor : str):
"""Views a specific reaction"""
data = self.config.get(ctx.message.server.id, {})
keyword = data.get(reactor, {})
if not keyword:
await self.bot.responses.failure(message="Reaction '{}' was not found.".format(reactor))
... | [
"async",
"def",
"viewreaction",
"(",
"self",
",",
"ctx",
",",
"*",
",",
"reactor",
":",
"str",
")",
":",
"data",
"=",
"self",
".",
"config",
".",
"get",
"(",
"ctx",
".",
"message",
".",
"server",
".",
"id",
",",
"{",
"}",
")",
"keyword",
"=",
"... | Views a specific reaction | [
"Views",
"a",
"specific",
"reaction"
] | 39bb98dae4e49487e6c6c597f85fc41c74b62bb8 | https://github.com/rauenzi/discordbot.py/blob/39bb98dae4e49487e6c6c597f85fc41c74b62bb8/discordbot/cogs/reactions.py#L112-L135 |
42,712 | rauenzi/discordbot.py | discordbot/discordbot.py | _default_help_command | async def _default_help_command(ctx, *commands : str):
"""Shows this message."""
bot = ctx.bot
destination = ctx.message.author if bot.pm_help else ctx.message.channel
def repl(obj):
return _mentions_transforms.get(obj.group(0), '')
# help by itself just lists our own commands.
if len(... | python | async def _default_help_command(ctx, *commands : str):
"""Shows this message."""
bot = ctx.bot
destination = ctx.message.author if bot.pm_help else ctx.message.channel
def repl(obj):
return _mentions_transforms.get(obj.group(0), '')
# help by itself just lists our own commands.
if len(... | [
"async",
"def",
"_default_help_command",
"(",
"ctx",
",",
"*",
"commands",
":",
"str",
")",
":",
"bot",
"=",
"ctx",
".",
"bot",
"destination",
"=",
"ctx",
".",
"message",
".",
"author",
"if",
"bot",
".",
"pm_help",
"else",
"ctx",
".",
"message",
".",
... | Shows this message. | [
"Shows",
"this",
"message",
"."
] | 39bb98dae4e49487e6c6c597f85fc41c74b62bb8 | https://github.com/rauenzi/discordbot.py/blob/39bb98dae4e49487e6c6c597f85fc41c74b62bb8/discordbot/discordbot.py#L15-L64 |
42,713 | Robpol86/libnl | libnl/attr.py | nla_ok | def nla_ok(nla, remaining):
"""Check if the attribute header and payload can be accessed safely.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L148
Verifies that the header and payload do not exceed the number of bytes left in the attribute stream. This function
must be called before ac... | python | def nla_ok(nla, remaining):
"""Check if the attribute header and payload can be accessed safely.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L148
Verifies that the header and payload do not exceed the number of bytes left in the attribute stream. This function
must be called before ac... | [
"def",
"nla_ok",
"(",
"nla",
",",
"remaining",
")",
":",
"return",
"remaining",
".",
"value",
">=",
"nla",
".",
"SIZEOF",
"and",
"nla",
".",
"SIZEOF",
"<=",
"nla",
".",
"nla_len",
"<=",
"remaining",
".",
"value"
] | Check if the attribute header and payload can be accessed safely.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L148
Verifies that the header and payload do not exceed the number of bytes left in the attribute stream. This function
must be called before access the attribute header or payloa... | [
"Check",
"if",
"the",
"attribute",
"header",
"and",
"payload",
"can",
"be",
"accessed",
"safely",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/attr.py#L160-L176 |
42,714 | Robpol86/libnl | libnl/attr.py | nla_next | def nla_next(nla, remaining):
"""Return next attribute in a stream of attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L171
Calculates the offset to the next attribute based on the attribute given. The attribute provided is assumed to be
accessible, the caller is responsible to... | python | def nla_next(nla, remaining):
"""Return next attribute in a stream of attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L171
Calculates the offset to the next attribute based on the attribute given. The attribute provided is assumed to be
accessible, the caller is responsible to... | [
"def",
"nla_next",
"(",
"nla",
",",
"remaining",
")",
":",
"totlen",
"=",
"int",
"(",
"NLA_ALIGN",
"(",
"nla",
".",
"nla_len",
")",
")",
"remaining",
".",
"value",
"-=",
"totlen",
"return",
"nlattr",
"(",
"bytearray_ptr",
"(",
"nla",
".",
"bytearray",
... | Return next attribute in a stream of attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L171
Calculates the offset to the next attribute based on the attribute given. The attribute provided is assumed to be
accessible, the caller is responsible to use nla_ok() beforehand. The offset ... | [
"Return",
"next",
"attribute",
"in",
"a",
"stream",
"of",
"attributes",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/attr.py#L179-L200 |
42,715 | Robpol86/libnl | libnl/attr.py | nla_parse | def nla_parse(tb, maxtype, head, len_, policy):
"""Create attribute index based on a stream of attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L242
Iterates over the stream of attributes and stores a pointer to each attribute in the index array using the attribute
type as inde... | python | def nla_parse(tb, maxtype, head, len_, policy):
"""Create attribute index based on a stream of attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L242
Iterates over the stream of attributes and stores a pointer to each attribute in the index array using the attribute
type as inde... | [
"def",
"nla_parse",
"(",
"tb",
",",
"maxtype",
",",
"head",
",",
"len_",
",",
"policy",
")",
":",
"rem",
"=",
"c_int",
"(",
")",
"for",
"nla",
"in",
"nla_for_each_attr",
"(",
"head",
",",
"len_",
",",
"rem",
")",
":",
"type_",
"=",
"nla_type",
"(",... | Create attribute index based on a stream of attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L242
Iterates over the stream of attributes and stores a pointer to each attribute in the index array using the attribute
type as index to the array. Attribute with a type greater than the ... | [
"Create",
"attribute",
"index",
"based",
"on",
"a",
"stream",
"of",
"attributes",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/attr.py#L253-L292 |
42,716 | Robpol86/libnl | libnl/attr.py | nla_for_each_attr | def nla_for_each_attr(head, len_, rem):
"""Iterate over a stream of attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/include/netlink/attr.h#L262
Positional arguments:
head -- first nlattr with more in its bytearray payload (nlattr class instance).
len_ -- length of attribute stream (i... | python | def nla_for_each_attr(head, len_, rem):
"""Iterate over a stream of attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/include/netlink/attr.h#L262
Positional arguments:
head -- first nlattr with more in its bytearray payload (nlattr class instance).
len_ -- length of attribute stream (i... | [
"def",
"nla_for_each_attr",
"(",
"head",
",",
"len_",
",",
"rem",
")",
":",
"pos",
"=",
"head",
"rem",
".",
"value",
"=",
"len_",
"while",
"nla_ok",
"(",
"pos",
",",
"rem",
")",
":",
"yield",
"pos",
"pos",
"=",
"nla_next",
"(",
"pos",
",",
"rem",
... | Iterate over a stream of attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/include/netlink/attr.h#L262
Positional arguments:
head -- first nlattr with more in its bytearray payload (nlattr class instance).
len_ -- length of attribute stream (integer).
rem -- initialized to len, holds b... | [
"Iterate",
"over",
"a",
"stream",
"of",
"attributes",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/attr.py#L295-L312 |
42,717 | Robpol86/libnl | libnl/attr.py | nla_for_each_nested | def nla_for_each_nested(nla, rem):
"""Iterate over a stream of nested attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/include/netlink/attr.h#L274
Positional arguments:
nla -- attribute containing the nested attributes (nlattr class instance).
rem -- initialized to len, holds bytes cu... | python | def nla_for_each_nested(nla, rem):
"""Iterate over a stream of nested attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/include/netlink/attr.h#L274
Positional arguments:
nla -- attribute containing the nested attributes (nlattr class instance).
rem -- initialized to len, holds bytes cu... | [
"def",
"nla_for_each_nested",
"(",
"nla",
",",
"rem",
")",
":",
"pos",
"=",
"nlattr",
"(",
"nla_data",
"(",
"nla",
")",
")",
"rem",
".",
"value",
"=",
"nla_len",
"(",
"nla",
")",
"while",
"nla_ok",
"(",
"pos",
",",
"rem",
")",
":",
"yield",
"pos",
... | Iterate over a stream of nested attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/include/netlink/attr.h#L274
Positional arguments:
nla -- attribute containing the nested attributes (nlattr class instance).
rem -- initialized to len, holds bytes currently remaining in stream (c_int).
... | [
"Iterate",
"over",
"a",
"stream",
"of",
"nested",
"attributes",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/attr.py#L315-L331 |
42,718 | Robpol86/libnl | libnl/attr.py | nla_find | def nla_find(head, len_, attrtype):
"""Find a single attribute in a stream of attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L323
Iterates over the stream of attributes and compares each type with the type specified. Returns the first attribute
which matches the type.
Po... | python | def nla_find(head, len_, attrtype):
"""Find a single attribute in a stream of attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L323
Iterates over the stream of attributes and compares each type with the type specified. Returns the first attribute
which matches the type.
Po... | [
"def",
"nla_find",
"(",
"head",
",",
"len_",
",",
"attrtype",
")",
":",
"rem",
"=",
"c_int",
"(",
")",
"for",
"nla",
"in",
"nla_for_each_attr",
"(",
"head",
",",
"len_",
",",
"rem",
")",
":",
"if",
"nla_type",
"(",
"nla",
")",
"==",
"attrtype",
":"... | Find a single attribute in a stream of attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L323
Iterates over the stream of attributes and compares each type with the type specified. Returns the first attribute
which matches the type.
Positional arguments:
head -- first nlatt... | [
"Find",
"a",
"single",
"attribute",
"in",
"a",
"stream",
"of",
"attributes",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/attr.py#L334-L354 |
42,719 | Robpol86/libnl | libnl/attr.py | nla_reserve | def nla_reserve(msg, attrtype, attrlen):
"""Reserve space for an attribute.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L456
Reserves room for an attribute in the specified Netlink message and fills in the attribute header (type, length).
Returns None if there is insufficient space fo... | python | def nla_reserve(msg, attrtype, attrlen):
"""Reserve space for an attribute.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L456
Reserves room for an attribute in the specified Netlink message and fills in the attribute header (type, length).
Returns None if there is insufficient space fo... | [
"def",
"nla_reserve",
"(",
"msg",
",",
"attrtype",
",",
"attrlen",
")",
":",
"tlen",
"=",
"NLMSG_ALIGN",
"(",
"msg",
".",
"nm_nlh",
".",
"nlmsg_len",
")",
"+",
"nla_total_size",
"(",
"attrlen",
")",
"if",
"tlen",
">",
"msg",
".",
"nm_size",
":",
"retur... | Reserve space for an attribute.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L456
Reserves room for an attribute in the specified Netlink message and fills in the attribute header (type, length).
Returns None if there is insufficient space for the attribute.
Any padding between payloa... | [
"Reserve",
"space",
"for",
"an",
"attribute",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/attr.py#L357-L392 |
42,720 | Robpol86/libnl | libnl/attr.py | nla_put | def nla_put(msg, attrtype, datalen, data):
"""Add a unspecific attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L497
Reserves room for an unspecific attribute and copies the provided data into the message as payload of the attribute.
Returns an error if there ... | python | def nla_put(msg, attrtype, datalen, data):
"""Add a unspecific attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L497
Reserves room for an unspecific attribute and copies the provided data into the message as payload of the attribute.
Returns an error if there ... | [
"def",
"nla_put",
"(",
"msg",
",",
"attrtype",
",",
"datalen",
",",
"data",
")",
":",
"nla",
"=",
"nla_reserve",
"(",
"msg",
",",
"attrtype",
",",
"datalen",
")",
"if",
"not",
"nla",
":",
"return",
"-",
"NLE_NOMEM",
"if",
"datalen",
"<=",
"0",
":",
... | Add a unspecific attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L497
Reserves room for an unspecific attribute and copies the provided data into the message as payload of the attribute.
Returns an error if there is insufficient space for the attribute.
Posi... | [
"Add",
"a",
"unspecific",
"attribute",
"to",
"Netlink",
"message",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/attr.py#L395-L421 |
42,721 | Robpol86/libnl | libnl/attr.py | nla_put_data | def nla_put_data(msg, attrtype, data):
"""Add abstract data as unspecific attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L527
Equivalent to nla_put() except that the length of the payload is derived from the bytearray data object.
Positional arguments:
... | python | def nla_put_data(msg, attrtype, data):
"""Add abstract data as unspecific attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L527
Equivalent to nla_put() except that the length of the payload is derived from the bytearray data object.
Positional arguments:
... | [
"def",
"nla_put_data",
"(",
"msg",
",",
"attrtype",
",",
"data",
")",
":",
"return",
"nla_put",
"(",
"msg",
",",
"attrtype",
",",
"len",
"(",
"data",
")",
",",
"data",
")"
] | Add abstract data as unspecific attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L527
Equivalent to nla_put() except that the length of the payload is derived from the bytearray data object.
Positional arguments:
msg -- Netlink message (nl_msg class instance)... | [
"Add",
"abstract",
"data",
"as",
"unspecific",
"attribute",
"to",
"Netlink",
"message",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/attr.py#L424-L439 |
42,722 | Robpol86/libnl | libnl/attr.py | nla_put_u8 | def nla_put_u8(msg, attrtype, value):
"""Add 8 bit integer attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L563
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
value -- numeric value to store... | python | def nla_put_u8(msg, attrtype, value):
"""Add 8 bit integer attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L563
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
value -- numeric value to store... | [
"def",
"nla_put_u8",
"(",
"msg",
",",
"attrtype",
",",
"value",
")",
":",
"data",
"=",
"bytearray",
"(",
"value",
"if",
"isinstance",
"(",
"value",
",",
"c_uint8",
")",
"else",
"c_uint8",
"(",
"value",
")",
")",
"return",
"nla_put",
"(",
"msg",
",",
... | Add 8 bit integer attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L563
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
value -- numeric value to store as payload (int() or c_uint8()).
Return... | [
"Add",
"8",
"bit",
"integer",
"attribute",
"to",
"Netlink",
"message",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/attr.py#L442-L456 |
42,723 | Robpol86/libnl | libnl/attr.py | nla_put_u16 | def nla_put_u16(msg, attrtype, value):
"""Add 16 bit integer attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L588
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
value -- numeric value to sto... | python | def nla_put_u16(msg, attrtype, value):
"""Add 16 bit integer attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L588
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
value -- numeric value to sto... | [
"def",
"nla_put_u16",
"(",
"msg",
",",
"attrtype",
",",
"value",
")",
":",
"data",
"=",
"bytearray",
"(",
"value",
"if",
"isinstance",
"(",
"value",
",",
"c_uint16",
")",
"else",
"c_uint16",
"(",
"value",
")",
")",
"return",
"nla_put",
"(",
"msg",
",",... | Add 16 bit integer attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L588
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
value -- numeric value to store as payload (int() or c_uint16()).
Retu... | [
"Add",
"16",
"bit",
"integer",
"attribute",
"to",
"Netlink",
"message",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/attr.py#L473-L487 |
42,724 | Robpol86/libnl | libnl/attr.py | nla_put_u32 | def nla_put_u32(msg, attrtype, value):
"""Add 32 bit integer attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L613
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
value -- numeric value to sto... | python | def nla_put_u32(msg, attrtype, value):
"""Add 32 bit integer attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L613
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
value -- numeric value to sto... | [
"def",
"nla_put_u32",
"(",
"msg",
",",
"attrtype",
",",
"value",
")",
":",
"data",
"=",
"bytearray",
"(",
"value",
"if",
"isinstance",
"(",
"value",
",",
"c_uint32",
")",
"else",
"c_uint32",
"(",
"value",
")",
")",
"return",
"nla_put",
"(",
"msg",
",",... | Add 32 bit integer attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L613
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
value -- numeric value to store as payload (int() or c_uint32()).
Retu... | [
"Add",
"32",
"bit",
"integer",
"attribute",
"to",
"Netlink",
"message",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/attr.py#L504-L518 |
42,725 | Robpol86/libnl | libnl/attr.py | nla_put_u64 | def nla_put_u64(msg, attrtype, value):
"""Add 64 bit integer attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L638
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
value -- numeric value to sto... | python | def nla_put_u64(msg, attrtype, value):
"""Add 64 bit integer attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L638
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
value -- numeric value to sto... | [
"def",
"nla_put_u64",
"(",
"msg",
",",
"attrtype",
",",
"value",
")",
":",
"data",
"=",
"bytearray",
"(",
"value",
"if",
"isinstance",
"(",
"value",
",",
"c_uint64",
")",
"else",
"c_uint64",
"(",
"value",
")",
")",
"return",
"nla_put",
"(",
"msg",
",",... | Add 64 bit integer attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L638
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
value -- numeric value to store as payload (int() or c_uint64()).
Retu... | [
"Add",
"64",
"bit",
"integer",
"attribute",
"to",
"Netlink",
"message",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/attr.py#L535-L549 |
42,726 | Robpol86/libnl | libnl/attr.py | nla_put_string | def nla_put_string(msg, attrtype, value):
"""Add string attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L674
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
value -- bytes() or bytearray() va... | python | def nla_put_string(msg, attrtype, value):
"""Add string attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L674
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
value -- bytes() or bytearray() va... | [
"def",
"nla_put_string",
"(",
"msg",
",",
"attrtype",
",",
"value",
")",
":",
"data",
"=",
"bytearray",
"(",
"value",
")",
"+",
"bytearray",
"(",
"b'\\0'",
")",
"return",
"nla_put",
"(",
"msg",
",",
"attrtype",
",",
"len",
"(",
"data",
")",
",",
"dat... | Add string attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L674
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
value -- bytes() or bytearray() value (e.g. 'Test'.encode('ascii')).
Returns:
... | [
"Add",
"string",
"attribute",
"to",
"Netlink",
"message",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/attr.py#L569-L583 |
42,727 | Robpol86/libnl | libnl/attr.py | nla_put_msecs | def nla_put_msecs(msg, attrtype, msecs):
"""Add msecs Netlink attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L737
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
msecs -- number of msecs (in... | python | def nla_put_msecs(msg, attrtype, msecs):
"""Add msecs Netlink attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L737
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
msecs -- number of msecs (in... | [
"def",
"nla_put_msecs",
"(",
"msg",
",",
"attrtype",
",",
"msecs",
")",
":",
"if",
"isinstance",
"(",
"msecs",
",",
"c_uint64",
")",
":",
"pass",
"elif",
"isinstance",
"(",
"msecs",
",",
"c_ulong",
")",
":",
"msecs",
"=",
"c_uint64",
"(",
"msecs",
".",... | Add msecs Netlink attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L737
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
msecs -- number of msecs (int(), c_uint64(), or c_ulong()).
Returns:
... | [
"Add",
"msecs",
"Netlink",
"attribute",
"to",
"Netlink",
"message",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/attr.py#L629-L648 |
42,728 | Robpol86/libnl | libnl/attr.py | nla_put_nested | def nla_put_nested(msg, attrtype, nested):
"""Add nested attributes to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L772
Takes the attributes found in the `nested` message and appends them to the message `msg` nested in a container of
the type `attrtype`. The `nested` ... | python | def nla_put_nested(msg, attrtype, nested):
"""Add nested attributes to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L772
Takes the attributes found in the `nested` message and appends them to the message `msg` nested in a container of
the type `attrtype`. The `nested` ... | [
"def",
"nla_put_nested",
"(",
"msg",
",",
"attrtype",
",",
"nested",
")",
":",
"_LOGGER",
".",
"debug",
"(",
"'msg 0x%x: attr <> %d: adding msg 0x%x as nested attribute'",
",",
"id",
"(",
"msg",
")",
",",
"attrtype",
",",
"id",
"(",
"nested",
")",
")",
"return... | Add nested attributes to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L772
Takes the attributes found in the `nested` message and appends them to the message `msg` nested in a container of
the type `attrtype`. The `nested` message may not have a family specific header.
... | [
"Add",
"nested",
"attributes",
"to",
"Netlink",
"message",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/attr.py#L665-L682 |
42,729 | Robpol86/libnl | libnl/attr.py | nla_parse_nested | def nla_parse_nested(tb, maxtype, nla, policy):
"""Create attribute index based on nested attribute.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L885
Feeds the stream of attributes nested into the specified attribute to nla_parse().
Positional arguments:
tb -- dictionary to be fi... | python | def nla_parse_nested(tb, maxtype, nla, policy):
"""Create attribute index based on nested attribute.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L885
Feeds the stream of attributes nested into the specified attribute to nla_parse().
Positional arguments:
tb -- dictionary to be fi... | [
"def",
"nla_parse_nested",
"(",
"tb",
",",
"maxtype",
",",
"nla",
",",
"policy",
")",
":",
"return",
"nla_parse",
"(",
"tb",
",",
"maxtype",
",",
"nlattr",
"(",
"nla_data",
"(",
"nla",
")",
")",
",",
"nla_len",
"(",
"nla",
")",
",",
"policy",
")"
] | Create attribute index based on nested attribute.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L885
Feeds the stream of attributes nested into the specified attribute to nla_parse().
Positional arguments:
tb -- dictionary to be filled (maxtype+1 elements).
maxtype -- maximum attri... | [
"Create",
"attribute",
"index",
"based",
"on",
"nested",
"attribute",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/attr.py#L685-L701 |
42,730 | Robpol86/libnl | libnl/genl/genl.py | genl_send_simple | def genl_send_simple(sk, family, cmd, version, flags):
"""Send a Generic Netlink message consisting only of a header.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/genl.c#L84
This function is a shortcut for sending a Generic Netlink message without any message payload. The message will only
... | python | def genl_send_simple(sk, family, cmd, version, flags):
"""Send a Generic Netlink message consisting only of a header.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/genl.c#L84
This function is a shortcut for sending a Generic Netlink message without any message payload. The message will only
... | [
"def",
"genl_send_simple",
"(",
"sk",
",",
"family",
",",
"cmd",
",",
"version",
",",
"flags",
")",
":",
"hdr",
"=",
"genlmsghdr",
"(",
"cmd",
"=",
"cmd",
",",
"version",
"=",
"version",
")",
"return",
"int",
"(",
"nl_send_simple",
"(",
"sk",
",",
"f... | Send a Generic Netlink message consisting only of a header.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/genl.c#L84
This function is a shortcut for sending a Generic Netlink message without any message payload. The message will only
consist of the Netlink and Generic Netlink headers. The hea... | [
"Send",
"a",
"Generic",
"Netlink",
"message",
"consisting",
"only",
"of",
"a",
"header",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/genl/genl.py#L44-L64 |
42,731 | Robpol86/libnl | libnl/genl/genl.py | genlmsg_valid_hdr | def genlmsg_valid_hdr(nlh, hdrlen):
"""Validate Generic Netlink message headers.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/genl.c#L117
Verifies the integrity of the Netlink and Generic Netlink headers by enforcing the following requirements:
- Valid Netlink message header (`nlmsg_vali... | python | def genlmsg_valid_hdr(nlh, hdrlen):
"""Validate Generic Netlink message headers.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/genl.c#L117
Verifies the integrity of the Netlink and Generic Netlink headers by enforcing the following requirements:
- Valid Netlink message header (`nlmsg_vali... | [
"def",
"genlmsg_valid_hdr",
"(",
"nlh",
",",
"hdrlen",
")",
":",
"if",
"not",
"nlmsg_valid_hdr",
"(",
"nlh",
",",
"GENL_HDRLEN",
")",
":",
"return",
"False",
"ghdr",
"=",
"genlmsghdr",
"(",
"nlmsg_data",
"(",
"nlh",
")",
")",
"if",
"genlmsg_len",
"(",
"g... | Validate Generic Netlink message headers.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/genl.c#L117
Verifies the integrity of the Netlink and Generic Netlink headers by enforcing the following requirements:
- Valid Netlink message header (`nlmsg_valid_hdr()`)
- Presence of a complete Gene... | [
"Validate",
"Generic",
"Netlink",
"message",
"headers",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/genl/genl.py#L67-L91 |
42,732 | Robpol86/libnl | libnl/genl/genl.py | genlmsg_parse | def genlmsg_parse(nlh, hdrlen, tb, maxtype, policy):
"""Parse Generic Netlink message including attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/genl.c#L191
Verifies the validity of the Netlink and Generic Netlink headers using genlmsg_valid_hdr() and calls nla_parse() on
the mes... | python | def genlmsg_parse(nlh, hdrlen, tb, maxtype, policy):
"""Parse Generic Netlink message including attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/genl.c#L191
Verifies the validity of the Netlink and Generic Netlink headers using genlmsg_valid_hdr() and calls nla_parse() on
the mes... | [
"def",
"genlmsg_parse",
"(",
"nlh",
",",
"hdrlen",
",",
"tb",
",",
"maxtype",
",",
"policy",
")",
":",
"if",
"not",
"genlmsg_valid_hdr",
"(",
"nlh",
",",
"hdrlen",
")",
":",
"return",
"-",
"NLE_MSG_TOOSHORT",
"ghdr",
"=",
"genlmsghdr",
"(",
"nlmsg_data",
... | Parse Generic Netlink message including attributes.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/genl.c#L191
Verifies the validity of the Netlink and Generic Netlink headers using genlmsg_valid_hdr() and calls nla_parse() on
the message payload to parse eventual attributes.
Positional a... | [
"Parse",
"Generic",
"Netlink",
"message",
"including",
"attributes",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/genl/genl.py#L94-L116 |
42,733 | Robpol86/libnl | libnl/genl/genl.py | genlmsg_len | def genlmsg_len(gnlh):
"""Return length of message payload including user header.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/genl.c#L224
Positional arguments:
gnlh -- Generic Netlink message header (genlmsghdr class instance).
Returns:
Length of user payload including an event... | python | def genlmsg_len(gnlh):
"""Return length of message payload including user header.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/genl.c#L224
Positional arguments:
gnlh -- Generic Netlink message header (genlmsghdr class instance).
Returns:
Length of user payload including an event... | [
"def",
"genlmsg_len",
"(",
"gnlh",
")",
":",
"nlh",
"=",
"nlmsghdr",
"(",
"bytearray_ptr",
"(",
"gnlh",
".",
"bytearray",
",",
"-",
"NLMSG_HDRLEN",
",",
"oob",
"=",
"True",
")",
")",
"return",
"nlh",
".",
"nlmsg_len",
"-",
"GENL_HDRLEN",
"-",
"NLMSG_HDRL... | Return length of message payload including user header.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/genl.c#L224
Positional arguments:
gnlh -- Generic Netlink message header (genlmsghdr class instance).
Returns:
Length of user payload including an eventual user header in number of b... | [
"Return",
"length",
"of",
"message",
"payload",
"including",
"user",
"header",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/genl/genl.py#L133-L145 |
42,734 | Robpol86/libnl | libnl/genl/genl.py | genlmsg_put | def genlmsg_put(msg, port, seq, family, hdrlen, flags, cmd, version):
"""Add Generic Netlink headers to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/genl.c#L348
Calls nlmsg_put() on the specified message object to reserve space for the Netlink header, the Generic Netlink
... | python | def genlmsg_put(msg, port, seq, family, hdrlen, flags, cmd, version):
"""Add Generic Netlink headers to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/genl.c#L348
Calls nlmsg_put() on the specified message object to reserve space for the Netlink header, the Generic Netlink
... | [
"def",
"genlmsg_put",
"(",
"msg",
",",
"port",
",",
"seq",
",",
"family",
",",
"hdrlen",
",",
"flags",
",",
"cmd",
",",
"version",
")",
":",
"hdr",
"=",
"genlmsghdr",
"(",
"cmd",
"=",
"cmd",
",",
"version",
"=",
"version",
")",
"nlh",
"=",
"nlmsg_p... | Add Generic Netlink headers to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/genl.c#L348
Calls nlmsg_put() on the specified message object to reserve space for the Netlink header, the Generic Netlink
header, and a user header of specified length. Fills out the header fields w... | [
"Add",
"Generic",
"Netlink",
"headers",
"to",
"Netlink",
"message",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/genl/genl.py#L211-L238 |
42,735 | Robpol86/libnl | libnl/netlink_private/netlink.py | nl_cb_call | def nl_cb_call(cb, type_, msg):
"""Call a callback function.
https://github.com/thom311/libnl/blob/libnl3_2_25/include/netlink-private/netlink.h#L136
Positional arguments:
cb -- nl_cb class instance.
type_ -- callback type integer (e.g. NL_CB_MSG_OUT).
msg -- Netlink message (nl_msg class inst... | python | def nl_cb_call(cb, type_, msg):
"""Call a callback function.
https://github.com/thom311/libnl/blob/libnl3_2_25/include/netlink-private/netlink.h#L136
Positional arguments:
cb -- nl_cb class instance.
type_ -- callback type integer (e.g. NL_CB_MSG_OUT).
msg -- Netlink message (nl_msg class inst... | [
"def",
"nl_cb_call",
"(",
"cb",
",",
"type_",
",",
"msg",
")",
":",
"cb",
".",
"cb_active",
"=",
"type_",
"ret",
"=",
"cb",
".",
"cb_set",
"[",
"type_",
"]",
"(",
"msg",
",",
"cb",
".",
"cb_args",
"[",
"type_",
"]",
")",
"cb",
".",
"cb_active",
... | Call a callback function.
https://github.com/thom311/libnl/blob/libnl3_2_25/include/netlink-private/netlink.h#L136
Positional arguments:
cb -- nl_cb class instance.
type_ -- callback type integer (e.g. NL_CB_MSG_OUT).
msg -- Netlink message (nl_msg class instance).
Returns:
Integer from t... | [
"Call",
"a",
"callback",
"function",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/netlink_private/netlink.py#L18-L34 |
42,736 | Robpol86/libnl | libnl/linux_private/netlink.py | sockaddr_nl.nl_pad | def nl_pad(self, value):
"""Pad setter."""
self.bytearray[self._get_slicers(1)] = bytearray(c_ushort(value or 0)) | python | def nl_pad(self, value):
"""Pad setter."""
self.bytearray[self._get_slicers(1)] = bytearray(c_ushort(value or 0)) | [
"def",
"nl_pad",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"bytearray",
"[",
"self",
".",
"_get_slicers",
"(",
"1",
")",
"]",
"=",
"bytearray",
"(",
"c_ushort",
"(",
"value",
"or",
"0",
")",
")"
] | Pad setter. | [
"Pad",
"setter",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/linux_private/netlink.py#L81-L83 |
42,737 | Robpol86/libnl | libnl/linux_private/netlink.py | sockaddr_nl.nl_groups | def nl_groups(self, value):
"""Group setter."""
self.bytearray[self._get_slicers(3)] = bytearray(c_uint32(value or 0)) | python | def nl_groups(self, value):
"""Group setter."""
self.bytearray[self._get_slicers(3)] = bytearray(c_uint32(value or 0)) | [
"def",
"nl_groups",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"bytearray",
"[",
"self",
".",
"_get_slicers",
"(",
"3",
")",
"]",
"=",
"bytearray",
"(",
"c_uint32",
"(",
"value",
"or",
"0",
")",
")"
] | Group setter. | [
"Group",
"setter",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/linux_private/netlink.py#L101-L103 |
42,738 | Robpol86/libnl | libnl/linux_private/netlink.py | nlmsghdr.nlmsg_type | def nlmsg_type(self, value):
"""Message content setter."""
self.bytearray[self._get_slicers(1)] = bytearray(c_uint16(value or 0)) | python | def nlmsg_type(self, value):
"""Message content setter."""
self.bytearray[self._get_slicers(1)] = bytearray(c_uint16(value or 0)) | [
"def",
"nlmsg_type",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"bytearray",
"[",
"self",
".",
"_get_slicers",
"(",
"1",
")",
"]",
"=",
"bytearray",
"(",
"c_uint16",
"(",
"value",
"or",
"0",
")",
")"
] | Message content setter. | [
"Message",
"content",
"setter",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/linux_private/netlink.py#L162-L164 |
42,739 | Robpol86/libnl | libnl/linux_private/netlink.py | nlmsghdr.nlmsg_seq | def nlmsg_seq(self, value):
"""Sequence setter."""
self.bytearray[self._get_slicers(3)] = bytearray(c_uint32(value or 0)) | python | def nlmsg_seq(self, value):
"""Sequence setter."""
self.bytearray[self._get_slicers(3)] = bytearray(c_uint32(value or 0)) | [
"def",
"nlmsg_seq",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"bytearray",
"[",
"self",
".",
"_get_slicers",
"(",
"3",
")",
"]",
"=",
"bytearray",
"(",
"c_uint32",
"(",
"value",
"or",
"0",
")",
")"
] | Sequence setter. | [
"Sequence",
"setter",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/linux_private/netlink.py#L182-L184 |
42,740 | Robpol86/libnl | libnl/socket_.py | nl_socket_alloc | def nl_socket_alloc(cb=None):
"""Allocate new Netlink socket. Does not yet actually open a socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L206
Also has code for generating local port once.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L123
Keyword arguments:
... | python | def nl_socket_alloc(cb=None):
"""Allocate new Netlink socket. Does not yet actually open a socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L206
Also has code for generating local port once.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L123
Keyword arguments:
... | [
"def",
"nl_socket_alloc",
"(",
"cb",
"=",
"None",
")",
":",
"# Allocate the callback.",
"cb",
"=",
"cb",
"or",
"nl_cb_alloc",
"(",
"default_cb",
")",
"if",
"not",
"cb",
":",
"return",
"None",
"# Allocate the socket.",
"sk",
"=",
"nl_sock",
"(",
")",
"sk",
... | Allocate new Netlink socket. Does not yet actually open a socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L206
Also has code for generating local port once.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L123
Keyword arguments:
cb -- custom callback handler.
... | [
"Allocate",
"new",
"Netlink",
"socket",
".",
"Does",
"not",
"yet",
"actually",
"open",
"a",
"socket",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/socket_.py#L64-L94 |
42,741 | Robpol86/libnl | libnl/socket_.py | nl_socket_add_memberships | def nl_socket_add_memberships(sk, *group):
"""Join groups.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L417
Joins the specified groups using the modern socket option. The list of groups has to be terminated by 0.
Make sure to use the correct group definitions as the older bitmask d... | python | def nl_socket_add_memberships(sk, *group):
"""Join groups.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L417
Joins the specified groups using the modern socket option. The list of groups has to be terminated by 0.
Make sure to use the correct group definitions as the older bitmask d... | [
"def",
"nl_socket_add_memberships",
"(",
"sk",
",",
"*",
"group",
")",
":",
"if",
"sk",
".",
"s_fd",
"==",
"-",
"1",
":",
"return",
"-",
"NLE_BAD_SOCK",
"for",
"grp",
"in",
"group",
":",
"if",
"not",
"grp",
":",
"break",
"if",
"grp",
"<",
"0",
":",... | Join groups.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L417
Joins the specified groups using the modern socket option. The list of groups has to be terminated by 0.
Make sure to use the correct group definitions as the older bitmask definitions for nl_join_groups() are likely to
... | [
"Join",
"groups",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/socket_.py#L122-L150 |
42,742 | Robpol86/libnl | libnl/socket_.py | nl_socket_drop_memberships | def nl_socket_drop_memberships(sk, *group):
"""Leave groups.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L465
Leaves the specified groups using the modern socket option. The list of groups has to terminated by 0.
Positional arguments:
sk -- Netlink socket (nl_sock class instanc... | python | def nl_socket_drop_memberships(sk, *group):
"""Leave groups.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L465
Leaves the specified groups using the modern socket option. The list of groups has to terminated by 0.
Positional arguments:
sk -- Netlink socket (nl_sock class instanc... | [
"def",
"nl_socket_drop_memberships",
"(",
"sk",
",",
"*",
"group",
")",
":",
"if",
"sk",
".",
"s_fd",
"==",
"-",
"1",
":",
"return",
"-",
"NLE_BAD_SOCK",
"for",
"grp",
"in",
"group",
":",
"if",
"not",
"grp",
":",
"break",
"if",
"grp",
"<",
"0",
":"... | Leave groups.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L465
Leaves the specified groups using the modern socket option. The list of groups has to terminated by 0.
Positional arguments:
sk -- Netlink socket (nl_sock class instance).
group -- group identifier (integer).
R... | [
"Leave",
"groups",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/socket_.py#L168-L193 |
42,743 | Robpol86/libnl | libnl/socket_.py | nl_socket_modify_cb | def nl_socket_modify_cb(sk, type_, kind, func, arg):
"""Modify the callback handler associated with the socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L633
Sets specific callback functions in the existing nl_cb class instance stored in the nl_sock socket.
Positional arguments:... | python | def nl_socket_modify_cb(sk, type_, kind, func, arg):
"""Modify the callback handler associated with the socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L633
Sets specific callback functions in the existing nl_cb class instance stored in the nl_sock socket.
Positional arguments:... | [
"def",
"nl_socket_modify_cb",
"(",
"sk",
",",
"type_",
",",
"kind",
",",
"func",
",",
"arg",
")",
":",
"return",
"int",
"(",
"nl_cb_set",
"(",
"sk",
".",
"s_cb",
",",
"type_",
",",
"kind",
",",
"func",
",",
"arg",
")",
")"
] | Modify the callback handler associated with the socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L633
Sets specific callback functions in the existing nl_cb class instance stored in the nl_sock socket.
Positional arguments:
sk -- Netlink socket (nl_sock class instance).
type... | [
"Modify",
"the",
"callback",
"handler",
"associated",
"with",
"the",
"socket",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/socket_.py#L239-L256 |
42,744 | Robpol86/libnl | libnl/socket_.py | nl_socket_modify_err_cb | def nl_socket_modify_err_cb(sk, kind, func, arg):
"""Modify the error callback handler associated with the socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L649
Positional arguments:
sk -- Netlink socket (nl_sock class instance).
kind -- kind of callback (integer).
func -... | python | def nl_socket_modify_err_cb(sk, kind, func, arg):
"""Modify the error callback handler associated with the socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L649
Positional arguments:
sk -- Netlink socket (nl_sock class instance).
kind -- kind of callback (integer).
func -... | [
"def",
"nl_socket_modify_err_cb",
"(",
"sk",
",",
"kind",
",",
"func",
",",
"arg",
")",
":",
"return",
"int",
"(",
"nl_cb_err",
"(",
"sk",
".",
"s_cb",
",",
"kind",
",",
"func",
",",
"arg",
")",
")"
] | Modify the error callback handler associated with the socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L649
Positional arguments:
sk -- Netlink socket (nl_sock class instance).
kind -- kind of callback (integer).
func -- callback function.
arg -- argument to be passed to ... | [
"Modify",
"the",
"error",
"callback",
"handler",
"associated",
"with",
"the",
"socket",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/socket_.py#L259-L273 |
42,745 | Robpol86/libnl | libnl/socket_.py | nl_socket_set_buffer_size | def nl_socket_set_buffer_size(sk, rxbuf, txbuf):
"""Set socket buffer size of Netlink socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L675
Sets the socket buffer size of a Netlink socket to the specified values `rxbuf` and `txbuf`. Providing a value of 0
assumes a good default v... | python | def nl_socket_set_buffer_size(sk, rxbuf, txbuf):
"""Set socket buffer size of Netlink socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L675
Sets the socket buffer size of a Netlink socket to the specified values `rxbuf` and `txbuf`. Providing a value of 0
assumes a good default v... | [
"def",
"nl_socket_set_buffer_size",
"(",
"sk",
",",
"rxbuf",
",",
"txbuf",
")",
":",
"rxbuf",
"=",
"32768",
"if",
"rxbuf",
"<=",
"0",
"else",
"rxbuf",
"txbuf",
"=",
"32768",
"if",
"txbuf",
"<=",
"0",
"else",
"txbuf",
"if",
"sk",
".",
"s_fd",
"==",
"-... | Set socket buffer size of Netlink socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/socket.c#L675
Sets the socket buffer size of a Netlink socket to the specified values `rxbuf` and `txbuf`. Providing a value of 0
assumes a good default value.
Positional arguments:
sk -- Netlink socke... | [
"Set",
"socket",
"buffer",
"size",
"of",
"Netlink",
"socket",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/socket_.py#L276-L308 |
42,746 | Robpol86/libnl | libnl/linux_private/genetlink.py | genlmsghdr.cmd | def cmd(self, value):
"""Command setter."""
self.bytearray[self._get_slicers(0)] = bytearray(c_uint8(value or 0)) | python | def cmd(self, value):
"""Command setter."""
self.bytearray[self._get_slicers(0)] = bytearray(c_uint8(value or 0)) | [
"def",
"cmd",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"bytearray",
"[",
"self",
".",
"_get_slicers",
"(",
"0",
")",
"]",
"=",
"bytearray",
"(",
"c_uint8",
"(",
"value",
"or",
"0",
")",
")"
] | Command setter. | [
"Command",
"setter",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/linux_private/genetlink.py#L51-L53 |
42,747 | Robpol86/libnl | libnl/linux_private/genetlink.py | genlmsghdr.version | def version(self, value):
"""Version setter."""
self.bytearray[self._get_slicers(1)] = bytearray(c_uint8(value or 0)) | python | def version(self, value):
"""Version setter."""
self.bytearray[self._get_slicers(1)] = bytearray(c_uint8(value or 0)) | [
"def",
"version",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"bytearray",
"[",
"self",
".",
"_get_slicers",
"(",
"1",
")",
"]",
"=",
"bytearray",
"(",
"c_uint8",
"(",
"value",
"or",
"0",
")",
")"
] | Version setter. | [
"Version",
"setter",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/linux_private/genetlink.py#L61-L63 |
42,748 | Robpol86/libnl | libnl/linux_private/genetlink.py | genlmsghdr.reserved | def reserved(self, value):
"""Reserved setter."""
self.bytearray[self._get_slicers(2)] = bytearray(c_uint16(value or 0)) | python | def reserved(self, value):
"""Reserved setter."""
self.bytearray[self._get_slicers(2)] = bytearray(c_uint16(value or 0)) | [
"def",
"reserved",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"bytearray",
"[",
"self",
".",
"_get_slicers",
"(",
"2",
")",
"]",
"=",
"bytearray",
"(",
"c_uint16",
"(",
"value",
"or",
"0",
")",
")"
] | Reserved setter. | [
"Reserved",
"setter",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/linux_private/genetlink.py#L71-L73 |
42,749 | Robpol86/libnl | libnl/nl80211/helpers.py | _get | def _get(out_parsed, in_bss, key, parser_func):
"""Handle calling the parser function to convert bytearray data into Python data types.
Positional arguments:
out_parsed -- dictionary to update with parsed data and string keys.
in_bss -- dictionary of integer keys and bytearray values.
key -- key st... | python | def _get(out_parsed, in_bss, key, parser_func):
"""Handle calling the parser function to convert bytearray data into Python data types.
Positional arguments:
out_parsed -- dictionary to update with parsed data and string keys.
in_bss -- dictionary of integer keys and bytearray values.
key -- key st... | [
"def",
"_get",
"(",
"out_parsed",
",",
"in_bss",
",",
"key",
",",
"parser_func",
")",
":",
"short_key",
"=",
"key",
"[",
"12",
":",
"]",
".",
"lower",
"(",
")",
"key_integer",
"=",
"getattr",
"(",
"nl80211",
",",
"key",
")",
"if",
"in_bss",
".",
"g... | Handle calling the parser function to convert bytearray data into Python data types.
Positional arguments:
out_parsed -- dictionary to update with parsed data and string keys.
in_bss -- dictionary of integer keys and bytearray values.
key -- key string to lookup (must be a variable name in libnl.nl8021... | [
"Handle",
"calling",
"the",
"parser",
"function",
"to",
"convert",
"bytearray",
"data",
"into",
"Python",
"data",
"types",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/nl80211/helpers.py#L10-L26 |
42,750 | Robpol86/libnl | libnl/nl80211/helpers.py | _fetch | def _fetch(in_parsed, *keys):
"""Retrieve nested dict data from either information elements or beacon IES dicts.
Positional arguments:
in_parsed -- dictionary to read from.
keys -- one or more nested dict keys to lookup.
Returns:
Found value or None.
"""
for ie in ('information_element... | python | def _fetch(in_parsed, *keys):
"""Retrieve nested dict data from either information elements or beacon IES dicts.
Positional arguments:
in_parsed -- dictionary to read from.
keys -- one or more nested dict keys to lookup.
Returns:
Found value or None.
"""
for ie in ('information_element... | [
"def",
"_fetch",
"(",
"in_parsed",
",",
"*",
"keys",
")",
":",
"for",
"ie",
"in",
"(",
"'information_elements'",
",",
"'beacon_ies'",
")",
":",
"target",
"=",
"in_parsed",
".",
"get",
"(",
"ie",
",",
"{",
"}",
")",
"for",
"key",
"in",
"keys",
":",
... | Retrieve nested dict data from either information elements or beacon IES dicts.
Positional arguments:
in_parsed -- dictionary to read from.
keys -- one or more nested dict keys to lookup.
Returns:
Found value or None. | [
"Retrieve",
"nested",
"dict",
"data",
"from",
"either",
"information",
"elements",
"or",
"beacon",
"IES",
"dicts",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/nl80211/helpers.py#L29-L45 |
42,751 | Robpol86/libnl | libnl/handlers.py | nl_cb_alloc | def nl_cb_alloc(kind):
"""Allocate a new callback handle.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/handlers.c#L201
Positional arguments:
kind -- callback kind to be used for initialization.
Returns:
Newly allocated callback handle (nl_cb class instance) or None.
"""
if ki... | python | def nl_cb_alloc(kind):
"""Allocate a new callback handle.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/handlers.c#L201
Positional arguments:
kind -- callback kind to be used for initialization.
Returns:
Newly allocated callback handle (nl_cb class instance) or None.
"""
if ki... | [
"def",
"nl_cb_alloc",
"(",
"kind",
")",
":",
"if",
"kind",
"<",
"0",
"or",
"kind",
">",
"NL_CB_KIND_MAX",
":",
"return",
"None",
"cb",
"=",
"nl_cb",
"(",
")",
"cb",
".",
"cb_active",
"=",
"NL_CB_TYPE_MAX",
"+",
"1",
"for",
"i",
"in",
"range",
"(",
... | Allocate a new callback handle.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/handlers.c#L201
Positional arguments:
kind -- callback kind to be used for initialization.
Returns:
Newly allocated callback handle (nl_cb class instance) or None. | [
"Allocate",
"a",
"new",
"callback",
"handle",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/handlers.py#L151-L169 |
42,752 | Robpol86/libnl | libnl/handlers.py | nl_cb_set | def nl_cb_set(cb, type_, kind, func, arg):
"""Set up a callback. Updates `cb` in place.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/handlers.c#L293
Positional arguments:
cb -- nl_cb class instance.
type_ -- callback to modify (integer).
kind -- kind of implementation (integer).
f... | python | def nl_cb_set(cb, type_, kind, func, arg):
"""Set up a callback. Updates `cb` in place.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/handlers.c#L293
Positional arguments:
cb -- nl_cb class instance.
type_ -- callback to modify (integer).
kind -- kind of implementation (integer).
f... | [
"def",
"nl_cb_set",
"(",
"cb",
",",
"type_",
",",
"kind",
",",
"func",
",",
"arg",
")",
":",
"if",
"type_",
"<",
"0",
"or",
"type_",
">",
"NL_CB_TYPE_MAX",
"or",
"kind",
"<",
"0",
"or",
"kind",
">",
"NL_CB_KIND_MAX",
":",
"return",
"-",
"NLE_RANGE",
... | Set up a callback. Updates `cb` in place.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/handlers.c#L293
Positional arguments:
cb -- nl_cb class instance.
type_ -- callback to modify (integer).
kind -- kind of implementation (integer).
func -- callback function (NL_CB_CUSTOM).
arg -... | [
"Set",
"up",
"a",
"callback",
".",
"Updates",
"cb",
"in",
"place",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/handlers.py#L191-L216 |
42,753 | Robpol86/libnl | libnl/handlers.py | nl_cb_err | def nl_cb_err(cb, kind, func, arg):
"""Set up an error callback. Updates `cb` in place.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/handlers.c#L343
Positional arguments:
cb -- nl_cb class instance.
kind -- kind of callback (integer).
func -- callback function.
arg -- argument to ... | python | def nl_cb_err(cb, kind, func, arg):
"""Set up an error callback. Updates `cb` in place.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/handlers.c#L343
Positional arguments:
cb -- nl_cb class instance.
kind -- kind of callback (integer).
func -- callback function.
arg -- argument to ... | [
"def",
"nl_cb_err",
"(",
"cb",
",",
"kind",
",",
"func",
",",
"arg",
")",
":",
"if",
"kind",
"<",
"0",
"or",
"kind",
">",
"NL_CB_KIND_MAX",
":",
"return",
"-",
"NLE_RANGE",
"if",
"kind",
"==",
"NL_CB_CUSTOM",
":",
"cb",
".",
"cb_err",
"=",
"func",
... | Set up an error callback. Updates `cb` in place.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/handlers.c#L343
Positional arguments:
cb -- nl_cb class instance.
kind -- kind of callback (integer).
func -- callback function.
arg -- argument to be passed to callback function.
Return... | [
"Set",
"up",
"an",
"error",
"callback",
".",
"Updates",
"cb",
"in",
"place",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/handlers.py#L219-L243 |
42,754 | Robpol86/libnl | libnl/linux_private/rtnetlink.py | ifinfomsg.ifi_index | def ifi_index(self, value):
"""Index setter."""
self.bytearray[self._get_slicers(3)] = bytearray(c_int(value or 0)) | python | def ifi_index(self, value):
"""Index setter."""
self.bytearray[self._get_slicers(3)] = bytearray(c_int(value or 0)) | [
"def",
"ifi_index",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"bytearray",
"[",
"self",
".",
"_get_slicers",
"(",
"3",
")",
"]",
"=",
"bytearray",
"(",
"c_int",
"(",
"value",
"or",
"0",
")",
")"
] | Index setter. | [
"Index",
"setter",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/linux_private/rtnetlink.py#L215-L217 |
42,755 | Robpol86/libnl | libnl/linux_private/rtnetlink.py | ifinfomsg.ifi_change | def ifi_change(self, value):
"""Change setter."""
self.bytearray[self._get_slicers(5)] = bytearray(c_uint(value or 0)) | python | def ifi_change(self, value):
"""Change setter."""
self.bytearray[self._get_slicers(5)] = bytearray(c_uint(value or 0)) | [
"def",
"ifi_change",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"bytearray",
"[",
"self",
".",
"_get_slicers",
"(",
"5",
")",
"]",
"=",
"bytearray",
"(",
"c_uint",
"(",
"value",
"or",
"0",
")",
")"
] | Change setter. | [
"Change",
"setter",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/linux_private/rtnetlink.py#L235-L237 |
42,756 | Robpol86/libnl | libnl/misc.py | _class_factory | def _class_factory(base):
"""Create subclasses of ctypes.
Positional arguments:
base -- base class to subclass.
Returns:
New class definition.
"""
class ClsPyPy(base):
def __repr__(self):
return repr(base(super(ClsPyPy, self).value))
@classmethod
def fr... | python | def _class_factory(base):
"""Create subclasses of ctypes.
Positional arguments:
base -- base class to subclass.
Returns:
New class definition.
"""
class ClsPyPy(base):
def __repr__(self):
return repr(base(super(ClsPyPy, self).value))
@classmethod
def fr... | [
"def",
"_class_factory",
"(",
"base",
")",
":",
"class",
"ClsPyPy",
"(",
"base",
")",
":",
"def",
"__repr__",
"(",
"self",
")",
":",
"return",
"repr",
"(",
"base",
"(",
"super",
"(",
"ClsPyPy",
",",
"self",
")",
".",
"value",
")",
")",
"@",
"classm... | Create subclasses of ctypes.
Positional arguments:
base -- base class to subclass.
Returns:
New class definition. | [
"Create",
"subclasses",
"of",
"ctypes",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/misc.py#L7-L50 |
42,757 | Robpol86/libnl | libnl/misc.py | ucred.pid | def pid(self, value):
"""Process ID setter."""
self.bytearray[self._get_slicers(0)] = bytearray(c_int32(value or 0)) | python | def pid(self, value):
"""Process ID setter."""
self.bytearray[self._get_slicers(0)] = bytearray(c_int32(value or 0)) | [
"def",
"pid",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"bytearray",
"[",
"self",
".",
"_get_slicers",
"(",
"0",
")",
"]",
"=",
"bytearray",
"(",
"c_int32",
"(",
"value",
"or",
"0",
")",
")"
] | Process ID setter. | [
"Process",
"ID",
"setter",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/misc.py#L183-L185 |
42,758 | Robpol86/libnl | libnl/misc.py | ucred.uid | def uid(self, value):
"""User ID setter."""
self.bytearray[self._get_slicers(1)] = bytearray(c_int32(value or 0)) | python | def uid(self, value):
"""User ID setter."""
self.bytearray[self._get_slicers(1)] = bytearray(c_int32(value or 0)) | [
"def",
"uid",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"bytearray",
"[",
"self",
".",
"_get_slicers",
"(",
"1",
")",
"]",
"=",
"bytearray",
"(",
"c_int32",
"(",
"value",
"or",
"0",
")",
")"
] | User ID setter. | [
"User",
"ID",
"setter",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/misc.py#L193-L195 |
42,759 | Robpol86/libnl | libnl/misc.py | ucred.gid | def gid(self, value):
"""Group ID setter."""
self.bytearray[self._get_slicers(2)] = bytearray(c_int32(value or 0)) | python | def gid(self, value):
"""Group ID setter."""
self.bytearray[self._get_slicers(2)] = bytearray(c_int32(value or 0)) | [
"def",
"gid",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"bytearray",
"[",
"self",
".",
"_get_slicers",
"(",
"2",
")",
"]",
"=",
"bytearray",
"(",
"c_int32",
"(",
"value",
"or",
"0",
")",
")"
] | Group ID setter. | [
"Group",
"ID",
"setter",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/misc.py#L203-L205 |
42,760 | joeferraro/mm | mm/util.py | put_skeleton_files_on_disk | def put_skeleton_files_on_disk(metadata_type, where, github_template=None, params={}):
"""
Generates file based on jinja2 templates
"""
api_name = params["api_name"]
file_name = github_template["file_name"]
template_source = config.connection.get_plugin_client_setting('mm_template_source', '... | python | def put_skeleton_files_on_disk(metadata_type, where, github_template=None, params={}):
"""
Generates file based on jinja2 templates
"""
api_name = params["api_name"]
file_name = github_template["file_name"]
template_source = config.connection.get_plugin_client_setting('mm_template_source', '... | [
"def",
"put_skeleton_files_on_disk",
"(",
"metadata_type",
",",
"where",
",",
"github_template",
"=",
"None",
",",
"params",
"=",
"{",
"}",
")",
":",
"api_name",
"=",
"params",
"[",
"\"api_name\"",
"]",
"file_name",
"=",
"github_template",
"[",
"\"file_name\"",
... | Generates file based on jinja2 templates | [
"Generates",
"file",
"based",
"on",
"jinja2",
"templates"
] | 43dce48a2249faab4d872c228ada9fbdbeec147b | https://github.com/joeferraro/mm/blob/43dce48a2249faab4d872c228ada9fbdbeec147b/mm/util.py#L468-L500 |
42,761 | Robpol86/libnl | libnl/genl/ctrl.py | genl_ctrl_probe_by_name | def genl_ctrl_probe_by_name(sk, name):
"""Look up generic Netlink family by family name querying the kernel directly.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/ctrl.c#L237
Directly query's the kernel for a given family name.
Note: This API call differs from genl_ctrl_search_by_name i... | python | def genl_ctrl_probe_by_name(sk, name):
"""Look up generic Netlink family by family name querying the kernel directly.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/ctrl.c#L237
Directly query's the kernel for a given family name.
Note: This API call differs from genl_ctrl_search_by_name i... | [
"def",
"genl_ctrl_probe_by_name",
"(",
"sk",
",",
"name",
")",
":",
"ret",
"=",
"genl_family_alloc",
"(",
")",
"if",
"not",
"ret",
":",
"return",
"None",
"genl_family_set_name",
"(",
"ret",
",",
"name",
")",
"msg",
"=",
"nlmsg_alloc",
"(",
")",
"orig",
"... | Look up generic Netlink family by family name querying the kernel directly.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/ctrl.c#L237
Directly query's the kernel for a given family name.
Note: This API call differs from genl_ctrl_search_by_name in that it queries the kernel directly, allowin... | [
"Look",
"up",
"generic",
"Netlink",
"family",
"by",
"family",
"name",
"querying",
"the",
"kernel",
"directly",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/genl/ctrl.py#L149-L186 |
42,762 | Robpol86/libnl | libnl/genl/ctrl.py | genl_ctrl_resolve | def genl_ctrl_resolve(sk, name):
"""Resolve Generic Netlink family name to numeric identifier.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/ctrl.c#L429
Resolves the Generic Netlink family name to the corresponding numeric family identifier. This function queries the
kernel directly, use ... | python | def genl_ctrl_resolve(sk, name):
"""Resolve Generic Netlink family name to numeric identifier.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/ctrl.c#L429
Resolves the Generic Netlink family name to the corresponding numeric family identifier. This function queries the
kernel directly, use ... | [
"def",
"genl_ctrl_resolve",
"(",
"sk",
",",
"name",
")",
":",
"family",
"=",
"genl_ctrl_probe_by_name",
"(",
"sk",
",",
"name",
")",
"if",
"family",
"is",
"None",
":",
"return",
"-",
"NLE_OBJ_NOTFOUND",
"return",
"int",
"(",
"genl_family_get_id",
"(",
"famil... | Resolve Generic Netlink family name to numeric identifier.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/ctrl.c#L429
Resolves the Generic Netlink family name to the corresponding numeric family identifier. This function queries the
kernel directly, use genl_ctrl_search_by_name() if you need t... | [
"Resolve",
"Generic",
"Netlink",
"family",
"name",
"to",
"numeric",
"identifier",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/genl/ctrl.py#L189-L208 |
42,763 | Robpol86/libnl | libnl/genl/ctrl.py | genl_ctrl_resolve_grp | def genl_ctrl_resolve_grp(sk, family_name, grp_name):
"""Resolve Generic Netlink family group name.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/ctrl.c#L471
Looks up the family object and resolves the group name to the numeric group identifier.
Positional arguments:
sk -- Generic Ne... | python | def genl_ctrl_resolve_grp(sk, family_name, grp_name):
"""Resolve Generic Netlink family group name.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/ctrl.c#L471
Looks up the family object and resolves the group name to the numeric group identifier.
Positional arguments:
sk -- Generic Ne... | [
"def",
"genl_ctrl_resolve_grp",
"(",
"sk",
",",
"family_name",
",",
"grp_name",
")",
":",
"family",
"=",
"genl_ctrl_probe_by_name",
"(",
"sk",
",",
"family_name",
")",
"if",
"family",
"is",
"None",
":",
"return",
"-",
"NLE_OBJ_NOTFOUND",
"return",
"genl_ctrl_grp... | Resolve Generic Netlink family group name.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/ctrl.c#L471
Looks up the family object and resolves the group name to the numeric group identifier.
Positional arguments:
sk -- Generic Netlink socket (nl_sock class instance).
family_name -- nam... | [
"Resolve",
"Generic",
"Netlink",
"family",
"group",
"name",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/genl/ctrl.py#L227-L245 |
42,764 | Robpol86/libnl | setup.py | _safe_read | def _safe_read(path, length):
"""Read file contents."""
if not os.path.exists(os.path.join(HERE, path)):
return ''
file_handle = codecs.open(os.path.join(HERE, path), encoding='utf-8')
contents = file_handle.read(length)
file_handle.close()
return contents | python | def _safe_read(path, length):
"""Read file contents."""
if not os.path.exists(os.path.join(HERE, path)):
return ''
file_handle = codecs.open(os.path.join(HERE, path), encoding='utf-8')
contents = file_handle.read(length)
file_handle.close()
return contents | [
"def",
"_safe_read",
"(",
"path",
",",
"length",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"os",
".",
"path",
".",
"join",
"(",
"HERE",
",",
"path",
")",
")",
":",
"return",
"''",
"file_handle",
"=",
"codecs",
".",
"open",
"("... | Read file contents. | [
"Read",
"file",
"contents",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/setup.py#L39-L46 |
42,765 | Robpol86/libnl | example_scan_access_points.py | error_handler | def error_handler(_, err, arg):
"""Update the mutable integer `arg` with the error code."""
arg.value = err.error
return libnl.handlers.NL_STOP | python | def error_handler(_, err, arg):
"""Update the mutable integer `arg` with the error code."""
arg.value = err.error
return libnl.handlers.NL_STOP | [
"def",
"error_handler",
"(",
"_",
",",
"err",
",",
"arg",
")",
":",
"arg",
".",
"value",
"=",
"err",
".",
"error",
"return",
"libnl",
".",
"handlers",
".",
"NL_STOP"
] | Update the mutable integer `arg` with the error code. | [
"Update",
"the",
"mutable",
"integer",
"arg",
"with",
"the",
"error",
"code",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/example_scan_access_points.py#L90-L93 |
42,766 | Robpol86/libnl | example_scan_access_points.py | callback_trigger | def callback_trigger(msg, arg):
"""Called when the kernel is done scanning. Only signals if it was successful or if it failed. No other data.
Positional arguments:
msg -- nl_msg class instance containing the data sent by the kernel.
arg -- mutable integer (ctypes.c_int()) to update with results.
R... | python | def callback_trigger(msg, arg):
"""Called when the kernel is done scanning. Only signals if it was successful or if it failed. No other data.
Positional arguments:
msg -- nl_msg class instance containing the data sent by the kernel.
arg -- mutable integer (ctypes.c_int()) to update with results.
R... | [
"def",
"callback_trigger",
"(",
"msg",
",",
"arg",
")",
":",
"gnlh",
"=",
"genlmsghdr",
"(",
"nlmsg_data",
"(",
"nlmsg_hdr",
"(",
"msg",
")",
")",
")",
"if",
"gnlh",
".",
"cmd",
"==",
"nl80211",
".",
"NL80211_CMD_SCAN_ABORTED",
":",
"arg",
".",
"value",
... | Called when the kernel is done scanning. Only signals if it was successful or if it failed. No other data.
Positional arguments:
msg -- nl_msg class instance containing the data sent by the kernel.
arg -- mutable integer (ctypes.c_int()) to update with results.
Returns:
An integer, value of NL_SKI... | [
"Called",
"when",
"the",
"kernel",
"is",
"done",
"scanning",
".",
"Only",
"signals",
"if",
"it",
"was",
"successful",
"or",
"if",
"it",
"failed",
".",
"No",
"other",
"data",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/example_scan_access_points.py#L102-L118 |
42,767 | Robpol86/libnl | example_scan_access_points.py | callback_dump | def callback_dump(msg, results):
"""Here is where SSIDs and their data is decoded from the binary data sent by the kernel.
This function is called once per SSID. Everything in `msg` pertains to just one SSID.
Positional arguments:
msg -- nl_msg class instance containing the data sent by the kernel.
... | python | def callback_dump(msg, results):
"""Here is where SSIDs and their data is decoded from the binary data sent by the kernel.
This function is called once per SSID. Everything in `msg` pertains to just one SSID.
Positional arguments:
msg -- nl_msg class instance containing the data sent by the kernel.
... | [
"def",
"callback_dump",
"(",
"msg",
",",
"results",
")",
":",
"bss",
"=",
"dict",
"(",
")",
"# To be filled by nla_parse_nested().",
"# First we must parse incoming data into manageable chunks and check for errors.",
"gnlh",
"=",
"genlmsghdr",
"(",
"nlmsg_data",
"(",
"nlmsg... | Here is where SSIDs and their data is decoded from the binary data sent by the kernel.
This function is called once per SSID. Everything in `msg` pertains to just one SSID.
Positional arguments:
msg -- nl_msg class instance containing the data sent by the kernel.
results -- dictionary to populate with... | [
"Here",
"is",
"where",
"SSIDs",
"and",
"their",
"data",
"is",
"decoded",
"from",
"the",
"binary",
"data",
"sent",
"by",
"the",
"kernel",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/example_scan_access_points.py#L121-L152 |
42,768 | Robpol86/libnl | example_scan_access_points.py | do_scan_trigger | def do_scan_trigger(sk, if_index, driver_id, mcid):
"""Issue a scan request to the kernel and wait for it to reply with a signal.
This function issues NL80211_CMD_TRIGGER_SCAN which requires root privileges.
The way NL80211 works is first you issue NL80211_CMD_TRIGGER_SCAN and wait for the kernel to signa... | python | def do_scan_trigger(sk, if_index, driver_id, mcid):
"""Issue a scan request to the kernel and wait for it to reply with a signal.
This function issues NL80211_CMD_TRIGGER_SCAN which requires root privileges.
The way NL80211 works is first you issue NL80211_CMD_TRIGGER_SCAN and wait for the kernel to signa... | [
"def",
"do_scan_trigger",
"(",
"sk",
",",
"if_index",
",",
"driver_id",
",",
"mcid",
")",
":",
"# First get the \"scan\" membership group ID and join the socket to the group.",
"_LOGGER",
".",
"debug",
"(",
"'Joining group %d.'",
",",
"mcid",
")",
"ret",
"=",
"nl_socket... | Issue a scan request to the kernel and wait for it to reply with a signal.
This function issues NL80211_CMD_TRIGGER_SCAN which requires root privileges.
The way NL80211 works is first you issue NL80211_CMD_TRIGGER_SCAN and wait for the kernel to signal that the scan is
done. When that signal occurs, data ... | [
"Issue",
"a",
"scan",
"request",
"to",
"the",
"kernel",
"and",
"wait",
"for",
"it",
"to",
"reply",
"with",
"a",
"signal",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/example_scan_access_points.py#L155-L224 |
42,769 | Robpol86/libnl | example_scan_access_points.py | eta_letters | def eta_letters(seconds):
"""Convert seconds remaining into human readable strings.
From https://github.com/Robpol86/etaprogress/blob/ad934d4/etaprogress/components/eta_conversions.py.
Positional arguments:
seconds -- integer/float indicating seconds remaining.
"""
final_days, final_hours, fin... | python | def eta_letters(seconds):
"""Convert seconds remaining into human readable strings.
From https://github.com/Robpol86/etaprogress/blob/ad934d4/etaprogress/components/eta_conversions.py.
Positional arguments:
seconds -- integer/float indicating seconds remaining.
"""
final_days, final_hours, fin... | [
"def",
"eta_letters",
"(",
"seconds",
")",
":",
"final_days",
",",
"final_hours",
",",
"final_minutes",
",",
"final_seconds",
"=",
"0",
",",
"0",
",",
"0",
",",
"seconds",
"if",
"final_seconds",
">=",
"86400",
":",
"final_days",
"=",
"int",
"(",
"final_sec... | Convert seconds remaining into human readable strings.
From https://github.com/Robpol86/etaprogress/blob/ad934d4/etaprogress/components/eta_conversions.py.
Positional arguments:
seconds -- integer/float indicating seconds remaining. | [
"Convert",
"seconds",
"remaining",
"into",
"human",
"readable",
"strings",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/example_scan_access_points.py#L257-L286 |
42,770 | Robpol86/libnl | example_scan_access_points.py | print_table | def print_table(data):
"""Print the table of detected SSIDs and their data to screen.
Positional arguments:
data -- list of dictionaries.
"""
table = AsciiTable([COLUMNS])
table.justify_columns[2] = 'right'
table.justify_columns[3] = 'right'
table.justify_columns[4] = 'right'
table_... | python | def print_table(data):
"""Print the table of detected SSIDs and their data to screen.
Positional arguments:
data -- list of dictionaries.
"""
table = AsciiTable([COLUMNS])
table.justify_columns[2] = 'right'
table.justify_columns[3] = 'right'
table.justify_columns[4] = 'right'
table_... | [
"def",
"print_table",
"(",
"data",
")",
":",
"table",
"=",
"AsciiTable",
"(",
"[",
"COLUMNS",
"]",
")",
"table",
".",
"justify_columns",
"[",
"2",
"]",
"=",
"'right'",
"table",
".",
"justify_columns",
"[",
"3",
"]",
"=",
"'right'",
"table",
".",
"justi... | Print the table of detected SSIDs and their data to screen.
Positional arguments:
data -- list of dictionaries. | [
"Print",
"the",
"table",
"of",
"detected",
"SSIDs",
"and",
"their",
"data",
"to",
"screen",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/example_scan_access_points.py#L289-L319 |
42,771 | joeferraro/mm | mm/sforce/base.py | SforceBaseClient.generateObject | def generateObject(self, sObjectType):
'''
Generate a Salesforce object, such as a Lead or Contact
'''
obj = self._sforce.factory.create('ens:sObject')
obj.type = sObjectType
return obj | python | def generateObject(self, sObjectType):
'''
Generate a Salesforce object, such as a Lead or Contact
'''
obj = self._sforce.factory.create('ens:sObject')
obj.type = sObjectType
return obj | [
"def",
"generateObject",
"(",
"self",
",",
"sObjectType",
")",
":",
"obj",
"=",
"self",
".",
"_sforce",
".",
"factory",
".",
"create",
"(",
"'ens:sObject'",
")",
"obj",
".",
"type",
"=",
"sObjectType",
"return",
"obj"
] | Generate a Salesforce object, such as a Lead or Contact | [
"Generate",
"a",
"Salesforce",
"object",
"such",
"as",
"a",
"Lead",
"or",
"Contact"
] | 43dce48a2249faab4d872c228ada9fbdbeec147b | https://github.com/joeferraro/mm/blob/43dce48a2249faab4d872c228ada9fbdbeec147b/mm/sforce/base.py#L179-L185 |
42,772 | joeferraro/mm | mm/sforce/base.py | SforceBaseClient._marshallSObjects | def _marshallSObjects(self, sObjects, tag = 'sObjects'):
'''
Marshall generic sObjects into a list of SAX elements
This code is going away ASAP
tag param is for nested objects (e.g. MergeRequest) where
key: object must be in <key/>, not <sObjects/>
'''
if not isinstance(sObjects, (tuple, l... | python | def _marshallSObjects(self, sObjects, tag = 'sObjects'):
'''
Marshall generic sObjects into a list of SAX elements
This code is going away ASAP
tag param is for nested objects (e.g. MergeRequest) where
key: object must be in <key/>, not <sObjects/>
'''
if not isinstance(sObjects, (tuple, l... | [
"def",
"_marshallSObjects",
"(",
"self",
",",
"sObjects",
",",
"tag",
"=",
"'sObjects'",
")",
":",
"if",
"not",
"isinstance",
"(",
"sObjects",
",",
"(",
"tuple",
",",
"list",
")",
")",
":",
"sObjects",
"=",
"(",
"sObjects",
",",
")",
"if",
"sObjects",
... | Marshall generic sObjects into a list of SAX elements
This code is going away ASAP
tag param is for nested objects (e.g. MergeRequest) where
key: object must be in <key/>, not <sObjects/> | [
"Marshall",
"generic",
"sObjects",
"into",
"a",
"list",
"of",
"SAX",
"elements"
] | 43dce48a2249faab4d872c228ada9fbdbeec147b | https://github.com/joeferraro/mm/blob/43dce48a2249faab4d872c228ada9fbdbeec147b/mm/sforce/base.py#L211-L251 |
42,773 | joeferraro/mm | mm/sforce/base.py | SforceBaseClient._setHeaders | def _setHeaders(self, call = None, **kwargs):
'''
Attach particular SOAP headers to the request depending on the method call made
'''
# All calls, including utility calls, set the session header
headers = {'SessionHeader': self._sessionHeader}
if 'debug_categories' in kwargs:
#ERROR, WARN... | python | def _setHeaders(self, call = None, **kwargs):
'''
Attach particular SOAP headers to the request depending on the method call made
'''
# All calls, including utility calls, set the session header
headers = {'SessionHeader': self._sessionHeader}
if 'debug_categories' in kwargs:
#ERROR, WARN... | [
"def",
"_setHeaders",
"(",
"self",
",",
"call",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# All calls, including utility calls, set the session header",
"headers",
"=",
"{",
"'SessionHeader'",
":",
"self",
".",
"_sessionHeader",
"}",
"if",
"'debug_categories'... | Attach particular SOAP headers to the request depending on the method call made | [
"Attach",
"particular",
"SOAP",
"headers",
"to",
"the",
"request",
"depending",
"on",
"the",
"method",
"call",
"made"
] | 43dce48a2249faab4d872c228ada9fbdbeec147b | https://github.com/joeferraro/mm/blob/43dce48a2249faab4d872c228ada9fbdbeec147b/mm/sforce/base.py#L266-L395 |
42,774 | joeferraro/mm | mm/sforce/base.py | SforceBaseClient.invalidateSessions | def invalidateSessions(self, sessionIds):
'''
Invalidate a Salesforce session
This should be used with extreme caution, for the following (undocumented) reason:
All API connections for a given user share a single session ID
This will call logout() WHICH LOGS OUT THAT USER FROM EVERY CONCURRENT SESS... | python | def invalidateSessions(self, sessionIds):
'''
Invalidate a Salesforce session
This should be used with extreme caution, for the following (undocumented) reason:
All API connections for a given user share a single session ID
This will call logout() WHICH LOGS OUT THAT USER FROM EVERY CONCURRENT SESS... | [
"def",
"invalidateSessions",
"(",
"self",
",",
"sessionIds",
")",
":",
"self",
".",
"_setHeaders",
"(",
"'invalidateSessions'",
")",
"return",
"self",
".",
"_handleResultTyping",
"(",
"self",
".",
"_sforce",
".",
"service",
".",
"invalidateSessions",
"(",
"sessi... | Invalidate a Salesforce session
This should be used with extreme caution, for the following (undocumented) reason:
All API connections for a given user share a single session ID
This will call logout() WHICH LOGS OUT THAT USER FROM EVERY CONCURRENT SESSION
return invalidateSessionsResult | [
"Invalidate",
"a",
"Salesforce",
"session"
] | 43dce48a2249faab4d872c228ada9fbdbeec147b | https://github.com/joeferraro/mm/blob/43dce48a2249faab4d872c228ada9fbdbeec147b/mm/sforce/base.py#L462-L473 |
42,775 | joeferraro/mm | mm/sforce/base.py | SforceBaseClient.query | def query(self, queryString):
'''
Executes a query against the specified object and returns data that matches
the specified criteria.
'''
self._setHeaders('query')
return self._sforce.service.query(queryString) | python | def query(self, queryString):
'''
Executes a query against the specified object and returns data that matches
the specified criteria.
'''
self._setHeaders('query')
return self._sforce.service.query(queryString) | [
"def",
"query",
"(",
"self",
",",
"queryString",
")",
":",
"self",
".",
"_setHeaders",
"(",
"'query'",
")",
"return",
"self",
".",
"_sforce",
".",
"service",
".",
"query",
"(",
"queryString",
")"
] | Executes a query against the specified object and returns data that matches
the specified criteria. | [
"Executes",
"a",
"query",
"against",
"the",
"specified",
"object",
"and",
"returns",
"data",
"that",
"matches",
"the",
"specified",
"criteria",
"."
] | 43dce48a2249faab4d872c228ada9fbdbeec147b | https://github.com/joeferraro/mm/blob/43dce48a2249faab4d872c228ada9fbdbeec147b/mm/sforce/base.py#L523-L529 |
42,776 | joeferraro/mm | mm/sforce/base.py | SforceBaseClient.queryAll | def queryAll(self, queryString):
'''
Retrieves data from specified objects, whether or not they have been deleted.
'''
self._setHeaders('queryAll')
return self._sforce.service.queryAll(queryString) | python | def queryAll(self, queryString):
'''
Retrieves data from specified objects, whether or not they have been deleted.
'''
self._setHeaders('queryAll')
return self._sforce.service.queryAll(queryString) | [
"def",
"queryAll",
"(",
"self",
",",
"queryString",
")",
":",
"self",
".",
"_setHeaders",
"(",
"'queryAll'",
")",
"return",
"self",
".",
"_sforce",
".",
"service",
".",
"queryAll",
"(",
"queryString",
")"
] | Retrieves data from specified objects, whether or not they have been deleted. | [
"Retrieves",
"data",
"from",
"specified",
"objects",
"whether",
"or",
"not",
"they",
"have",
"been",
"deleted",
"."
] | 43dce48a2249faab4d872c228ada9fbdbeec147b | https://github.com/joeferraro/mm/blob/43dce48a2249faab4d872c228ada9fbdbeec147b/mm/sforce/base.py#L531-L536 |
42,777 | joeferraro/mm | mm/sforce/base.py | SforceBaseClient.queryMore | def queryMore(self, queryLocator):
'''
Retrieves the next batch of objects from a query.
'''
self._setHeaders('queryMore')
return self._sforce.service.queryMore(queryLocator) | python | def queryMore(self, queryLocator):
'''
Retrieves the next batch of objects from a query.
'''
self._setHeaders('queryMore')
return self._sforce.service.queryMore(queryLocator) | [
"def",
"queryMore",
"(",
"self",
",",
"queryLocator",
")",
":",
"self",
".",
"_setHeaders",
"(",
"'queryMore'",
")",
"return",
"self",
".",
"_sforce",
".",
"service",
".",
"queryMore",
"(",
"queryLocator",
")"
] | Retrieves the next batch of objects from a query. | [
"Retrieves",
"the",
"next",
"batch",
"of",
"objects",
"from",
"a",
"query",
"."
] | 43dce48a2249faab4d872c228ada9fbdbeec147b | https://github.com/joeferraro/mm/blob/43dce48a2249faab4d872c228ada9fbdbeec147b/mm/sforce/base.py#L538-L543 |
42,778 | joeferraro/mm | mm/sforce/base.py | SforceBaseClient.resetPassword | def resetPassword(self, userId):
'''
Changes a user's password to a system-generated value.
'''
self._setHeaders('resetPassword')
return self._sforce.service.resetPassword(userId) | python | def resetPassword(self, userId):
'''
Changes a user's password to a system-generated value.
'''
self._setHeaders('resetPassword')
return self._sforce.service.resetPassword(userId) | [
"def",
"resetPassword",
"(",
"self",
",",
"userId",
")",
":",
"self",
".",
"_setHeaders",
"(",
"'resetPassword'",
")",
"return",
"self",
".",
"_sforce",
".",
"service",
".",
"resetPassword",
"(",
"userId",
")"
] | Changes a user's password to a system-generated value. | [
"Changes",
"a",
"user",
"s",
"password",
"to",
"a",
"system",
"-",
"generated",
"value",
"."
] | 43dce48a2249faab4d872c228ada9fbdbeec147b | https://github.com/joeferraro/mm/blob/43dce48a2249faab4d872c228ada9fbdbeec147b/mm/sforce/base.py#L592-L597 |
42,779 | joeferraro/mm | mm/sforce/base.py | SforceBaseClient.setPassword | def setPassword(self, userId, password):
'''
Sets the specified user's password to the specified value.
'''
self._setHeaders('setPassword')
return self._sforce.service.setPassword(userId, password) | python | def setPassword(self, userId, password):
'''
Sets the specified user's password to the specified value.
'''
self._setHeaders('setPassword')
return self._sforce.service.setPassword(userId, password) | [
"def",
"setPassword",
"(",
"self",
",",
"userId",
",",
"password",
")",
":",
"self",
".",
"_setHeaders",
"(",
"'setPassword'",
")",
"return",
"self",
".",
"_sforce",
".",
"service",
".",
"setPassword",
"(",
"userId",
",",
"password",
")"
] | Sets the specified user's password to the specified value. | [
"Sets",
"the",
"specified",
"user",
"s",
"password",
"to",
"the",
"specified",
"value",
"."
] | 43dce48a2249faab4d872c228ada9fbdbeec147b | https://github.com/joeferraro/mm/blob/43dce48a2249faab4d872c228ada9fbdbeec147b/mm/sforce/base.py#L603-L608 |
42,780 | Robpol86/libnl | libnl/cache_mngt.py | nl_msgtype_lookup | def nl_msgtype_lookup(ops, msgtype):
"""Lookup message type cache association.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/cache_mngt.c#L189
Searches for a matching message type association ing the specified cache operations.
Positional arguments:
ops -- cache operations (nl_cache_ops c... | python | def nl_msgtype_lookup(ops, msgtype):
"""Lookup message type cache association.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/cache_mngt.c#L189
Searches for a matching message type association ing the specified cache operations.
Positional arguments:
ops -- cache operations (nl_cache_ops c... | [
"def",
"nl_msgtype_lookup",
"(",
"ops",
",",
"msgtype",
")",
":",
"for",
"i",
"in",
"ops",
".",
"co_msgtypes",
":",
"if",
"i",
".",
"mt_id",
"==",
"msgtype",
":",
"return",
"i",
"return",
"None"
] | Lookup message type cache association.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/cache_mngt.c#L189
Searches for a matching message type association ing the specified cache operations.
Positional arguments:
ops -- cache operations (nl_cache_ops class instance).
msgtype -- Netlink messa... | [
"Lookup",
"message",
"type",
"cache",
"association",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/cache_mngt.py#L77-L94 |
42,781 | Robpol86/libnl | libnl/cache_mngt.py | nl_cache_mngt_register | def nl_cache_mngt_register(ops):
"""Register a set of cache operations.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/cache_mngt.c#L252
Called by users of caches to announce the availability of a certain cache type.
Positional arguments:
ops -- cache operations (nl_cache_ops class instanc... | python | def nl_cache_mngt_register(ops):
"""Register a set of cache operations.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/cache_mngt.c#L252
Called by users of caches to announce the availability of a certain cache type.
Positional arguments:
ops -- cache operations (nl_cache_ops class instanc... | [
"def",
"nl_cache_mngt_register",
"(",
"ops",
")",
":",
"global",
"cache_ops",
"if",
"not",
"ops",
".",
"co_name",
"or",
"not",
"ops",
".",
"co_obj_ops",
":",
"return",
"-",
"NLE_INVAL",
"with",
"cache_ops_lock",
":",
"if",
"_nl_cache_ops_lookup",
"(",
"ops",
... | Register a set of cache operations.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/cache_mngt.c#L252
Called by users of caches to announce the availability of a certain cache type.
Positional arguments:
ops -- cache operations (nl_cache_ops class instance).
Returns:
0 on success or a ... | [
"Register",
"a",
"set",
"of",
"cache",
"operations",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/cache_mngt.py#L97-L123 |
42,782 | Robpol86/libnl | libnl/nl.py | nl_connect | def nl_connect(sk, protocol):
"""Create file descriptor and bind socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L96
Creates a new Netlink socket using `socket.socket()` and binds the socket to the protocol and local port specified
in the `sk` socket object (if any). Fails if the so... | python | def nl_connect(sk, protocol):
"""Create file descriptor and bind socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L96
Creates a new Netlink socket using `socket.socket()` and binds the socket to the protocol and local port specified
in the `sk` socket object (if any). Fails if the so... | [
"def",
"nl_connect",
"(",
"sk",
",",
"protocol",
")",
":",
"flags",
"=",
"getattr",
"(",
"socket",
",",
"'SOCK_CLOEXEC'",
",",
"0",
")",
"if",
"sk",
".",
"s_fd",
"!=",
"-",
"1",
":",
"return",
"-",
"NLE_BAD_SOCK",
"try",
":",
"sk",
".",
"socket_insta... | Create file descriptor and bind socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L96
Creates a new Netlink socket using `socket.socket()` and binds the socket to the protocol and local port specified
in the `sk` socket object (if any). Fails if the socket is already connected.
Posit... | [
"Create",
"file",
"descriptor",
"and",
"bind",
"socket",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/nl.py#L42-L83 |
42,783 | Robpol86/libnl | libnl/nl.py | nl_complete_msg | def nl_complete_msg(sk, msg):
"""Finalize Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L450
This function finalizes a Netlink message by completing the message with desirable flags and values depending on the
socket configuration.
- If not yet filled out, the source... | python | def nl_complete_msg(sk, msg):
"""Finalize Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L450
This function finalizes a Netlink message by completing the message with desirable flags and values depending on the
socket configuration.
- If not yet filled out, the source... | [
"def",
"nl_complete_msg",
"(",
"sk",
",",
"msg",
")",
":",
"nlh",
"=",
"msg",
".",
"nm_nlh",
"if",
"nlh",
".",
"nlmsg_pid",
"==",
"NL_AUTO_PORT",
":",
"nlh",
".",
"nlmsg_pid",
"=",
"nl_socket_get_local_port",
"(",
"sk",
")",
"if",
"nlh",
".",
"nlmsg_seq"... | Finalize Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L450
This function finalizes a Netlink message by completing the message with desirable flags and values depending on the
socket configuration.
- If not yet filled out, the source address of the message (`nlmsg_pid`)... | [
"Finalize",
"Netlink",
"message",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/nl.py#L213-L242 |
42,784 | Robpol86/libnl | libnl/nl.py | nl_send_simple | def nl_send_simple(sk, type_, flags, buf=None, size=0):
"""Construct and transmit a Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L549
Allocates a new Netlink message based on `type_` and `flags`. If `buf` points to payload of length `size` that
payload will be appended t... | python | def nl_send_simple(sk, type_, flags, buf=None, size=0):
"""Construct and transmit a Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L549
Allocates a new Netlink message based on `type_` and `flags`. If `buf` points to payload of length `size` that
payload will be appended t... | [
"def",
"nl_send_simple",
"(",
"sk",
",",
"type_",
",",
"flags",
",",
"buf",
"=",
"None",
",",
"size",
"=",
"0",
")",
":",
"msg",
"=",
"nlmsg_alloc_simple",
"(",
"type_",
",",
"flags",
")",
"if",
"buf",
"is",
"not",
"None",
"and",
"size",
":",
"err"... | Construct and transmit a Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L549
Allocates a new Netlink message based on `type_` and `flags`. If `buf` points to payload of length `size` that
payload will be appended to the message.
Sends out the message using `nl_send_auto()... | [
"Construct",
"and",
"transmit",
"a",
"Netlink",
"message",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/nl.py#L265-L292 |
42,785 | Robpol86/libnl | libnl/nl.py | nl_recv | def nl_recv(sk, nla, buf, creds=None):
"""Receive data from Netlink socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L625
Receives data from a connected netlink socket using recvmsg() and returns the number of bytes read. The read data is
stored in a newly allocated buffer that is as... | python | def nl_recv(sk, nla, buf, creds=None):
"""Receive data from Netlink socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L625
Receives data from a connected netlink socket using recvmsg() and returns the number of bytes read. The read data is
stored in a newly allocated buffer that is as... | [
"def",
"nl_recv",
"(",
"sk",
",",
"nla",
",",
"buf",
",",
"creds",
"=",
"None",
")",
":",
"flags",
"=",
"0",
"page_size",
"=",
"resource",
".",
"getpagesize",
"(",
")",
"*",
"4",
"if",
"sk",
".",
"s_flags",
"&",
"NL_MSG_PEEK",
":",
"flags",
"|=",
... | Receive data from Netlink socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L625
Receives data from a connected netlink socket using recvmsg() and returns the number of bytes read. The read data is
stored in a newly allocated buffer that is assigned to `buf`. The peer's netlink address wi... | [
"Receive",
"data",
"from",
"Netlink",
"socket",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/nl.py#L295-L376 |
42,786 | Robpol86/libnl | libnl/nl.py | nl_recvmsgs_report | def nl_recvmsgs_report(sk, cb):
"""Receive a set of messages from a Netlink socket and report parsed messages.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L998
This function is identical to nl_recvmsgs() to the point that it will return the number of parsed messages instead
of 0 on succ... | python | def nl_recvmsgs_report(sk, cb):
"""Receive a set of messages from a Netlink socket and report parsed messages.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L998
This function is identical to nl_recvmsgs() to the point that it will return the number of parsed messages instead
of 0 on succ... | [
"def",
"nl_recvmsgs_report",
"(",
"sk",
",",
"cb",
")",
":",
"if",
"cb",
".",
"cb_recvmsgs_ow",
":",
"return",
"int",
"(",
"cb",
".",
"cb_recvmsgs_ow",
"(",
"sk",
",",
"cb",
")",
")",
"return",
"int",
"(",
"recvmsgs",
"(",
"sk",
",",
"cb",
")",
")"... | Receive a set of messages from a Netlink socket and report parsed messages.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L998
This function is identical to nl_recvmsgs() to the point that it will return the number of parsed messages instead
of 0 on success.
See nl_recvmsgs().
Posit... | [
"Receive",
"a",
"set",
"of",
"messages",
"from",
"a",
"Netlink",
"socket",
"and",
"report",
"parsed",
"messages",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/nl.py#L624-L643 |
42,787 | Robpol86/libnl | libnl/nl.py | nl_recvmsgs | def nl_recvmsgs(sk, cb):
"""Receive a set of messages from a Netlink socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L1023
Repeatedly calls nl_recv() or the respective replacement if provided by the application (see nl_cb_overwrite_recv())
and parses the received data as Netlink mes... | python | def nl_recvmsgs(sk, cb):
"""Receive a set of messages from a Netlink socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L1023
Repeatedly calls nl_recv() or the respective replacement if provided by the application (see nl_cb_overwrite_recv())
and parses the received data as Netlink mes... | [
"def",
"nl_recvmsgs",
"(",
"sk",
",",
"cb",
")",
":",
"err",
"=",
"nl_recvmsgs_report",
"(",
"sk",
",",
"cb",
")",
"if",
"err",
">",
"0",
":",
"return",
"0",
"return",
"int",
"(",
"err",
")"
] | Receive a set of messages from a Netlink socket.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L1023
Repeatedly calls nl_recv() or the respective replacement if provided by the application (see nl_cb_overwrite_recv())
and parses the received data as Netlink messages. Stops reading if one of t... | [
"Receive",
"a",
"set",
"of",
"messages",
"from",
"a",
"Netlink",
"socket",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/nl.py#L646-L669 |
42,788 | Robpol86/libnl | libnl/nl.py | nl_wait_for_ack | def nl_wait_for_ack(sk):
"""Wait for ACK.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L1058
Waits until an ACK is received for the latest not yet acknowledged Netlink message.
Positional arguments:
sk -- Netlink socket (nl_sock class instance).
Returns:
Number of received ... | python | def nl_wait_for_ack(sk):
"""Wait for ACK.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L1058
Waits until an ACK is received for the latest not yet acknowledged Netlink message.
Positional arguments:
sk -- Netlink socket (nl_sock class instance).
Returns:
Number of received ... | [
"def",
"nl_wait_for_ack",
"(",
"sk",
")",
":",
"cb",
"=",
"nl_cb_clone",
"(",
"sk",
".",
"s_cb",
")",
"nl_cb_set",
"(",
"cb",
",",
"NL_CB_ACK",
",",
"NL_CB_CUSTOM",
",",
"lambda",
"*",
"_",
":",
"NL_STOP",
",",
"None",
")",
"return",
"int",
"(",
"nl_... | Wait for ACK.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/nl.c#L1058
Waits until an ACK is received for the latest not yet acknowledged Netlink message.
Positional arguments:
sk -- Netlink socket (nl_sock class instance).
Returns:
Number of received messages or a negative error cod... | [
"Wait",
"for",
"ACK",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/nl.py#L704-L719 |
42,789 | joeferraro/mm | mm/connection.py | PluginConnection.get_plugin_client_settings | def get_plugin_client_settings(self):
settings = {}
user_path = self.get_plugin_settings_path("User")
def_path = self.get_plugin_settings_path("MavensMate")
'''
if the default path for settings is none, we're either dealing with a bad client setup or
a new client... | python | def get_plugin_client_settings(self):
settings = {}
user_path = self.get_plugin_settings_path("User")
def_path = self.get_plugin_settings_path("MavensMate")
'''
if the default path for settings is none, we're either dealing with a bad client setup or
a new client... | [
"def",
"get_plugin_client_settings",
"(",
"self",
")",
":",
"settings",
"=",
"{",
"}",
"user_path",
"=",
"self",
".",
"get_plugin_settings_path",
"(",
"\"User\"",
")",
"def_path",
"=",
"self",
".",
"get_plugin_settings_path",
"(",
"\"MavensMate\"",
")",
"if",
"d... | if the default path for settings is none, we're either dealing with a bad client setup or
a new client like Atom.io. Let's load the settings from the default cache and optionally allow
them to pipe settings in via STDIN | [
"if",
"the",
"default",
"path",
"for",
"settings",
"is",
"none",
"we",
"re",
"either",
"dealing",
"with",
"a",
"bad",
"client",
"setup",
"or",
"a",
"new",
"client",
"like",
"Atom",
".",
"io",
".",
"Let",
"s",
"load",
"the",
"settings",
"from",
"the",
... | 43dce48a2249faab4d872c228ada9fbdbeec147b | https://github.com/joeferraro/mm/blob/43dce48a2249faab4d872c228ada9fbdbeec147b/mm/connection.py#L176-L216 |
42,790 | Robpol86/libnl | libnl/msg.py | nlmsg_for_each_attr | def nlmsg_for_each_attr(nlh, hdrlen, rem):
"""Iterate over a stream of attributes in a message.
https://github.com/thom311/libnl/blob/libnl3_2_25/include/netlink/msg.h#L123
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
hdrlen -- length of family header (integer).
... | python | def nlmsg_for_each_attr(nlh, hdrlen, rem):
"""Iterate over a stream of attributes in a message.
https://github.com/thom311/libnl/blob/libnl3_2_25/include/netlink/msg.h#L123
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
hdrlen -- length of family header (integer).
... | [
"def",
"nlmsg_for_each_attr",
"(",
"nlh",
",",
"hdrlen",
",",
"rem",
")",
":",
"return",
"nla_for_each_attr",
"(",
"nlmsg_attrdata",
"(",
"nlh",
",",
"hdrlen",
")",
",",
"nlmsg_attrlen",
"(",
"nlh",
",",
"hdrlen",
")",
",",
"rem",
")"
] | Iterate over a stream of attributes in a message.
https://github.com/thom311/libnl/blob/libnl3_2_25/include/netlink/msg.h#L123
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
hdrlen -- length of family header (integer).
rem -- initialized to len, holds bytes currentl... | [
"Iterate",
"over",
"a",
"stream",
"of",
"attributes",
"in",
"a",
"message",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/msg.py#L70-L83 |
42,791 | Robpol86/libnl | libnl/msg.py | nlmsg_attrdata | def nlmsg_attrdata(nlh, hdrlen):
"""Head of attributes data.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L143
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
hdrlen -- length of family specific header (integer).
Returns:
First attribute (nlat... | python | def nlmsg_attrdata(nlh, hdrlen):
"""Head of attributes data.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L143
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
hdrlen -- length of family specific header (integer).
Returns:
First attribute (nlat... | [
"def",
"nlmsg_attrdata",
"(",
"nlh",
",",
"hdrlen",
")",
":",
"data",
"=",
"nlmsg_data",
"(",
"nlh",
")",
"return",
"libnl",
".",
"linux_private",
".",
"netlink",
".",
"nlattr",
"(",
"bytearray_ptr",
"(",
"data",
",",
"libnl",
".",
"linux_private",
".",
... | Head of attributes data.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L143
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
hdrlen -- length of family specific header (integer).
Returns:
First attribute (nlattr class instance with others in its pay... | [
"Head",
"of",
"attributes",
"data",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/msg.py#L86-L99 |
42,792 | Robpol86/libnl | libnl/msg.py | nlmsg_attrlen | def nlmsg_attrlen(nlh, hdrlen):
"""Length of attributes data.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L154
nlh -- Netlink message header (nlmsghdr class instance).
hdrlen -- length of family specific header (integer).
Returns:
Integer.
"""
return max(nlmsg_len(nlh)... | python | def nlmsg_attrlen(nlh, hdrlen):
"""Length of attributes data.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L154
nlh -- Netlink message header (nlmsghdr class instance).
hdrlen -- length of family specific header (integer).
Returns:
Integer.
"""
return max(nlmsg_len(nlh)... | [
"def",
"nlmsg_attrlen",
"(",
"nlh",
",",
"hdrlen",
")",
":",
"return",
"max",
"(",
"nlmsg_len",
"(",
"nlh",
")",
"-",
"libnl",
".",
"linux_private",
".",
"netlink",
".",
"NLMSG_ALIGN",
"(",
"hdrlen",
")",
",",
"0",
")"
] | Length of attributes data.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L154
nlh -- Netlink message header (nlmsghdr class instance).
hdrlen -- length of family specific header (integer).
Returns:
Integer. | [
"Length",
"of",
"attributes",
"data",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/msg.py#L102-L113 |
42,793 | Robpol86/libnl | libnl/msg.py | nlmsg_ok | def nlmsg_ok(nlh, remaining):
"""Check if the Netlink message fits into the remaining bytes.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L179
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
remaining -- number of bytes remaining in message stream (c_i... | python | def nlmsg_ok(nlh, remaining):
"""Check if the Netlink message fits into the remaining bytes.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L179
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
remaining -- number of bytes remaining in message stream (c_i... | [
"def",
"nlmsg_ok",
"(",
"nlh",
",",
"remaining",
")",
":",
"sizeof",
"=",
"libnl",
".",
"linux_private",
".",
"netlink",
".",
"nlmsghdr",
".",
"SIZEOF",
"return",
"remaining",
".",
"value",
">=",
"sizeof",
"and",
"sizeof",
"<=",
"nlh",
".",
"nlmsg_len",
... | Check if the Netlink message fits into the remaining bytes.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L179
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
remaining -- number of bytes remaining in message stream (c_int).
Returns:
Boolean. | [
"Check",
"if",
"the",
"Netlink",
"message",
"fits",
"into",
"the",
"remaining",
"bytes",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/msg.py#L128-L141 |
42,794 | Robpol86/libnl | libnl/msg.py | nlmsg_next | def nlmsg_next(nlh, remaining):
"""Next Netlink message in message stream.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L194
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
remaining -- number of bytes remaining in message stream (c_int).
Returns:... | python | def nlmsg_next(nlh, remaining):
"""Next Netlink message in message stream.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L194
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
remaining -- number of bytes remaining in message stream (c_int).
Returns:... | [
"def",
"nlmsg_next",
"(",
"nlh",
",",
"remaining",
")",
":",
"totlen",
"=",
"libnl",
".",
"linux_private",
".",
"netlink",
".",
"NLMSG_ALIGN",
"(",
"nlh",
".",
"nlmsg_len",
")",
"remaining",
".",
"value",
"-=",
"totlen",
"return",
"libnl",
".",
"linux_priv... | Next Netlink message in message stream.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L194
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
remaining -- number of bytes remaining in message stream (c_int).
Returns:
The next Netlink message in the me... | [
"Next",
"Netlink",
"message",
"in",
"message",
"stream",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/msg.py#L144-L158 |
42,795 | Robpol86/libnl | libnl/msg.py | nlmsg_parse | def nlmsg_parse(nlh, hdrlen, tb, maxtype, policy):
"""Parse attributes of a Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L213
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
hdrlen -- length of family specific header (integer).
tb ... | python | def nlmsg_parse(nlh, hdrlen, tb, maxtype, policy):
"""Parse attributes of a Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L213
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
hdrlen -- length of family specific header (integer).
tb ... | [
"def",
"nlmsg_parse",
"(",
"nlh",
",",
"hdrlen",
",",
"tb",
",",
"maxtype",
",",
"policy",
")",
":",
"if",
"not",
"nlmsg_valid_hdr",
"(",
"nlh",
",",
"hdrlen",
")",
":",
"return",
"-",
"NLE_MSG_TOOSHORT",
"return",
"nla_parse",
"(",
"tb",
",",
"maxtype",... | Parse attributes of a Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L213
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
hdrlen -- length of family specific header (integer).
tb -- dictionary of nlattr instances (length of maxtype+1).
... | [
"Parse",
"attributes",
"of",
"a",
"Netlink",
"message",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/msg.py#L161-L178 |
42,796 | Robpol86/libnl | libnl/msg.py | nlmsg_find_attr | def nlmsg_find_attr(nlh, hdrlen, attrtype):
"""Find a specific attribute in a Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L231
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
hdrlen -- length of family specific header (integer).
a... | python | def nlmsg_find_attr(nlh, hdrlen, attrtype):
"""Find a specific attribute in a Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L231
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
hdrlen -- length of family specific header (integer).
a... | [
"def",
"nlmsg_find_attr",
"(",
"nlh",
",",
"hdrlen",
",",
"attrtype",
")",
":",
"return",
"nla_find",
"(",
"nlmsg_attrdata",
"(",
"nlh",
",",
"hdrlen",
")",
",",
"nlmsg_attrlen",
"(",
"nlh",
",",
"hdrlen",
")",
",",
"attrtype",
")"
] | Find a specific attribute in a Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L231
Positional arguments:
nlh -- Netlink message header (nlmsghdr class instance).
hdrlen -- length of family specific header (integer).
attrtype -- type of attribute to look for (integer).... | [
"Find",
"a",
"specific",
"attribute",
"in",
"a",
"Netlink",
"message",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/msg.py#L181-L194 |
42,797 | Robpol86/libnl | libnl/msg.py | nlmsg_alloc | def nlmsg_alloc(len_=default_msg_size):
"""Allocate a new Netlink message with maximum payload size specified.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L299
Allocates a new Netlink message without any further payload. The maximum payload size defaults to
resource.getpagesize() or as... | python | def nlmsg_alloc(len_=default_msg_size):
"""Allocate a new Netlink message with maximum payload size specified.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L299
Allocates a new Netlink message without any further payload. The maximum payload size defaults to
resource.getpagesize() or as... | [
"def",
"nlmsg_alloc",
"(",
"len_",
"=",
"default_msg_size",
")",
":",
"len_",
"=",
"max",
"(",
"libnl",
".",
"linux_private",
".",
"netlink",
".",
"nlmsghdr",
".",
"SIZEOF",
",",
"len_",
")",
"nm",
"=",
"nl_msg",
"(",
")",
"nm",
".",
"nm_refcnt",
"=",
... | Allocate a new Netlink message with maximum payload size specified.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L299
Allocates a new Netlink message without any further payload. The maximum payload size defaults to
resource.getpagesize() or as otherwise specified with nlmsg_set_default_siz... | [
"Allocate",
"a",
"new",
"Netlink",
"message",
"with",
"maximum",
"payload",
"size",
"specified",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/msg.py#L197-L216 |
42,798 | Robpol86/libnl | libnl/msg.py | nlmsg_inherit | def nlmsg_inherit(hdr=None):
"""Allocate a new Netlink message and inherit Netlink message header.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L322
Allocates a new Netlink message and inherits the original message header. If `hdr` is not None it will be used as a
template for the Netli... | python | def nlmsg_inherit(hdr=None):
"""Allocate a new Netlink message and inherit Netlink message header.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L322
Allocates a new Netlink message and inherits the original message header. If `hdr` is not None it will be used as a
template for the Netli... | [
"def",
"nlmsg_inherit",
"(",
"hdr",
"=",
"None",
")",
":",
"nm",
"=",
"nlmsg_alloc",
"(",
")",
"if",
"hdr",
":",
"new",
"=",
"nm",
".",
"nm_nlh",
"new",
".",
"nlmsg_type",
"=",
"hdr",
".",
"nlmsg_type",
"new",
".",
"nlmsg_flags",
"=",
"hdr",
".",
"... | Allocate a new Netlink message and inherit Netlink message header.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L322
Allocates a new Netlink message and inherits the original message header. If `hdr` is not None it will be used as a
template for the Netlink message header, otherwise the hea... | [
"Allocate",
"a",
"new",
"Netlink",
"message",
"and",
"inherit",
"Netlink",
"message",
"header",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/msg.py#L222-L243 |
42,799 | Robpol86/libnl | libnl/msg.py | nlmsg_alloc_simple | def nlmsg_alloc_simple(nlmsgtype, flags):
"""Allocate a new Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L346
Positional arguments:
nlmsgtype -- Netlink message type (integer).
flags -- message flags (integer).
Returns:
Newly allocated Netlink message (nl_m... | python | def nlmsg_alloc_simple(nlmsgtype, flags):
"""Allocate a new Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L346
Positional arguments:
nlmsgtype -- Netlink message type (integer).
flags -- message flags (integer).
Returns:
Newly allocated Netlink message (nl_m... | [
"def",
"nlmsg_alloc_simple",
"(",
"nlmsgtype",
",",
"flags",
")",
":",
"nlh",
"=",
"libnl",
".",
"linux_private",
".",
"netlink",
".",
"nlmsghdr",
"(",
"nlmsg_type",
"=",
"nlmsgtype",
",",
"nlmsg_flags",
"=",
"flags",
")",
"msg",
"=",
"nlmsg_inherit",
"(",
... | Allocate a new Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L346
Positional arguments:
nlmsgtype -- Netlink message type (integer).
flags -- message flags (integer).
Returns:
Newly allocated Netlink message (nl_msg class instance) or None. | [
"Allocate",
"a",
"new",
"Netlink",
"message",
"."
] | 274e9fdaa39822d06ef70b799ed4a95937a4d923 | https://github.com/Robpol86/libnl/blob/274e9fdaa39822d06ef70b799ed4a95937a4d923/libnl/msg.py#L246-L261 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.