Sorry, forgot about hex() function. Thanks! It Works -----Original Message----- From: Kea-users [mailto:[email protected]] On Behalf Of perl-list Sent: Wednesday, 15 September 2021 15:40 To: kea-users Subject: Re: [Kea-users] Leases storage format
I believe: select hex(hwaddr) from lease4; will get you an ASCII mac address. Someone correct me if I'm wrong. ----- Original Message ----- > From: "egor grijuc" <[email protected]> > To: "Klaus Steden" <[email protected]>, [email protected] > Cc: "kea-users" <[email protected]> > Sent: Wednesday, September 15, 2021 3:02:00 AM > Subject: Re: [Kea-users] Leases storage format > Same problem with lease6 table. > The sytax of create table lease4 > CREATE TABLE `lease4` ( > `address` int(10) unsigned NOT NULL, > `hwaddr` varbinary(20) DEFAULT NULL, > `client_id` varbinary(128) DEFAULT NULL, > `valid_lifetime` int(10) unsigned DEFAULT NULL, > `expire` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE > CURRENT_TIMESTAMP, > `subnet_id` int(10) unsigned DEFAULT NULL, > `fqdn_fwd` tinyint(1) DEFAULT NULL, > `fqdn_rev` tinyint(1) DEFAULT NULL, > `hostname` varchar(255) DEFAULT NULL, > `state` int(10) unsigned DEFAULT '0', > `user_context` text, > `mycol` varchar(254) DEFAULT NULL, > PRIMARY KEY (`address`), > KEY `lease4_by_hwaddr_subnet_id` (`hwaddr`,`subnet_id`), > KEY `lease4_by_client_id_subnet_id` (`client_id`,`subnet_id`), > KEY `lease4_by_state_expire` (`state`,`expire`), > KEY `lease4_by_subnet_id` (`subnet_id`), > KEY `lease4_by_hostname` (`hostname`), > CONSTRAINT `fk_lease4_state` FOREIGN KEY (`state`) REFERENCES `lease_state` > (`state`) > ) ENGINE=InnoDB DEFAULT CHARSET=latin1 > From: Kea-users [mailto:[email protected]] On Behalf Of Egor > GRIJUC > Sent: Wednesday, 15 September 2021 09:58 > To: Klaus Steden; [email protected] > Cc: kea-users > Subject: Re: [Kea-users] Leases storage format > Yes, but in mysql log I see query from kea in format: > UPDATE lease4 SET address = 1682022402, hwaddr = '`▒\\', client_id = '`▒\\', > valid_lifetime = 21600, expire = '2021-09-07 20:12:16', subnet_id = 2, > fqdn_fwd > = 0, fqdn_rev = 0, hostname = 'hg8247u', state = 0, user_context = NULL WHERE > address = 1682022402 AND expire = '2021-09-07 18:52:56' > The fields hwaddr = '`▒\\', client_id = '`▒\\' > It it normal? How to convert this to mac address? > From: Kea-users [mailto:[email protected]] On Behalf Of Klaus > Steden > Sent: Wednesday, 15 September 2021 01:52 > To: [email protected] > Cc: kea-users > Subject: Re: [Kea-users] Leases storage format > The hwaddr field in MySQL is stored as hexadecimal. > You want to use HEX/UNHEX to convert between ASCII presentation and hex > encoding. > cheers, > Klaus > On Tue, Sep 7, 2021 at 4:19 AM < [ mailto:[email protected] | > [email protected] ] > wrote: >> Hello. >> I have 1 question and one issue with storing leases information in mysql >> database in kea. >> The issue is that hwaddr field and client_id field are in "strange" format. >> I enabled query log in mysql and in logs i found the following query from kea >> UPDATE lease4 SET address = 1682022402, hwaddr = '`▒\\', client_id = '`▒\\', >> valid_lifetime = 21600, expire = '2021-09-07 20:12:16', subnet_id = 2, >> fqdn_fwd >> = 0, fqdn_rev = 0, hostname = 'hg8247u', state = 0, user_context = NULL WHERE >> address = 1682022402 AND expire = '2021-09-07 18:52:56' >> So you can see " hwaddr = '`▒\\', client_id = '`▒\\' " >> Does someone faced same problem? How to fix it? >> Second part is question. >> Lease4 table have several fields. The question: is it possible to store >> additional information, like option 82, suboption 9? >> _______________________________________________ >> ISC funds the development of this software with paid support subscriptions. >> Contact us at [ https://www.isc.org/contact/ | https://www.isc.org/contact/ ] >> for more information. >> To unsubscribe visit [ https://lists.isc.org/mailman/listinfo/kea-users | >> https://lists.isc.org/mailman/listinfo/kea-users ] . >> Kea-users mailing list >> [ mailto:[email protected] | [email protected] ] >> [ https://lists.isc.org/mailman/listinfo/kea-users | >> https://lists.isc.org/mailman/listinfo/kea-users ] > _________________________________________________________________________________________________________________________ > Ce message et ses pieces jointes peuvent contenir des informations > confidentielles ou privilegiees et ne doivent donc > pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce > message par erreur, veuillez le signaler > a l'expediteur et le detruire ainsi que les pieces jointes. Les messages > electroniques etant susceptibles d'alteration, > Orange decline toute responsabilite si ce message a ete altere, deforme ou > falsifie. Merci. > This message and its attachments may contain confidential or privileged > information that may be protected by law; > they should not be distributed, used or copied without authorisation. > If you have received this email in error, please notify the sender and delete > this message and its attachments. > As emails may be altered, Orange is not liable for messages that have been > modified, changed or falsified. > Thank you. > _________________________________________________________________________________________________________________________ > Ce message et ses pieces jointes peuvent contenir des informations > confidentielles ou privilegiees et ne doivent donc > pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce > message par erreur, veuillez le signaler > a l'expediteur et le detruire ainsi que les pieces jointes. Les messages > electroniques etant susceptibles d'alteration, > Orange decline toute responsabilite si ce message a ete altere, deforme ou > falsifie. Merci. > This message and its attachments may contain confidential or privileged > information that may be protected by law; > they should not be distributed, used or copied without authorisation. > If you have received this email in error, please notify the sender and delete > this message and its attachments. > As emails may be altered, Orange is not liable for messages that have been > modified, changed or falsified. > Thank you. > _______________________________________________ > ISC funds the development of this software with paid support subscriptions. > Contact us at https://www.isc.org/contact/ for more information. > To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users. > Kea-users mailing list > [email protected] > https://lists.isc.org/mailman/listinfo/kea-users _______________________________________________ ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information. To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users. Kea-users mailing list [email protected] https://lists.isc.org/mailman/listinfo/kea-users _________________________________________________________________________________________________________________________ Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci. This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you. _______________________________________________ ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information. To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users. Kea-users mailing list [email protected] https://lists.isc.org/mailman/listinfo/kea-users
