sd-dhcp6-client.h revision 04c0136989b7eb896bfb0fb176e11233d69e1453
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner#ifndef foosddhcp6clienthfoo
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye#define foosddhcp6clienthfoo
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye/***
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen This file is part of systemd.
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye Copyright (C) 2014 Intel Corporation. All rights reserved.
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye systemd is free software; you can redistribute it and/or modify it
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye under the terms of the GNU Lesser General Public License as published by
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye the Free Software Foundation; either version 2.1 of the License, or
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye (at your option) any later version.
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye systemd is distributed in the hope that it will be useful, but
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye WITHOUT ANY WARRANTY; without even the implied warranty of
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye Lesser General Public License for more details.
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye You should have received a copy of the GNU Lesser General Public License
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye along with systemd; If not, see <http://www.gnu.org/licenses/>.
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye***/
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner
02508b90a0eace220eabd5ec85ff37e9009c6b16Lubos Kosco#include <inttypes.h>
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner#include <net/ethernet.h>
be72dc8ed6dfce2445cea09638f601a08b9175e2Trond Norbye#include <sys/types.h>
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner#include "sd-event.h"
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner#include "sd-dhcp6-lease.h"
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner#include "_sd-common.h"
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner_SD_BEGIN_DECLARATIONS;
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner
14a41f02433890d19b2f871156271e3388cd0845Jens Elknerenum {
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner SD_DHCP6_CLIENT_EVENT_STOP = 0,
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner SD_DHCP6_CLIENT_EVENT_RESEND_EXPIRE = 10,
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner SD_DHCP6_CLIENT_EVENT_RETRANS_MAX = 11,
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner SD_DHCP6_CLIENT_EVENT_IP_ACQUIRE = 12,
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner SD_DHCP6_CLIENT_EVENT_INFORMATION_REQUEST = 13,
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen};
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlentypedef struct sd_dhcp6_client sd_dhcp6_client;
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlentypedef void (*sd_dhcp6_client_cb_t)(sd_dhcp6_client *client, int event,
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen void *userdata);
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlenint sd_dhcp6_client_set_callback(sd_dhcp6_client *client,
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen sd_dhcp6_client_cb_t cb, void *userdata);
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlenint sd_dhcp6_client_set_index(sd_dhcp6_client *client, int interface_index);
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlenint sd_dhcp6_client_set_mac(sd_dhcp6_client *client, const uint8_t *addr,
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen size_t addr_len, uint16_t arp_type);
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlenint sd_dhcp6_client_set_duid(sd_dhcp6_client *client, uint16_t type, uint8_t *duid,
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen size_t duid_len);
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlenint sd_dhcp6_client_set_information_request(sd_dhcp6_client *client, int enabled);
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlenint sd_dhcp6_client_get_information_request(sd_dhcp6_client *client, int *enabled);
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlenint sd_dhcp6_client_set_request_option(sd_dhcp6_client *client,
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen uint16_t option);
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlenint sd_dhcp6_client_get_lease(sd_dhcp6_client *client, sd_dhcp6_lease **ret);
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlenint sd_dhcp6_client_stop(sd_dhcp6_client *client);
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlenint sd_dhcp6_client_start(sd_dhcp6_client *client);
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlenint sd_dhcp6_client_attach_event(sd_dhcp6_client *client, sd_event *event,
981e542f40f5acaf95b69c5854e5ffb080204242Lubos Kosco int priority);
ff32508916722fc0e579f39b5bf22936116b8829Lubos Koscoint sd_dhcp6_client_detach_event(sd_dhcp6_client *client);
73100f4d1c412f00eb2568969d935cf3182b0d77Lubos Koscosd_event *sd_dhcp6_client_get_event(sd_dhcp6_client *client);
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlensd_dhcp6_client *sd_dhcp6_client_ref(sd_dhcp6_client *client);
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlensd_dhcp6_client *sd_dhcp6_client_unref(sd_dhcp6_client *client);
ff32508916722fc0e579f39b5bf22936116b8829Lubos Koscoint sd_dhcp6_client_new(sd_dhcp6_client **ret);
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen_SD_END_DECLARATIONS;
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner#endif
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner