~ubuntu-branches/debian/sid/isc-dhcp/sid

« back to all changes in this revision

Viewing changes to common/comapi.c

  • Committer: Package Import Robot
  • Author(s): Andrew Pollock
  • Date: 2012-06-09 14:01:05 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120609140105-lqcz2t0rsefwzamt
Tags: 4.2.4-1
* New upstream release
* debian/control: reformatted Uploaders so that dch doesn't think I'm making
  NMUs
* debian/rules: do a clean between the LDAP-enabled build and the
  non-LDAP-enabled one, so that no LDAP-related artefacts are accidently
  incorporated into the non-LDAP build
* debian/dhclient-script.*: conditionalise the chown/chmod of the new
  resolv.conf on the existence of the old one (closes: #595400)
* debian/dhclient-script.linux: comply with RFC 3442 and ignore
  the routers option if the rfc3442-classless-static-routes option is present
  (closes: #592735)
* debian/dhclient-script.kfreebsd: fix subnet mask handling (closes: #677985)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
   OMAPI object interfaces for the DHCP server. */
4
4
 
5
5
/*
 
6
 * Copyright (c) 2012 Internet Systems Consortium, Inc. ("ISC")
6
7
 * Copyright (c) 2004-2007,2009 by Internet Systems Consortium, Inc. ("ISC")
7
8
 * Copyright (c) 1999-2003 by Internet Software Consortium
8
9
 *
435
436
 
436
437
        status = dhcp_group_destroy ((omapi_object_t *)group, MDL);
437
438
 
438
 
        return ISC_R_SUCCESS;
 
439
        return status;
439
440
}
440
441
 
441
442
isc_result_t dhcp_control_set_value  (omapi_object_t *h,
511
512
isc_result_t dhcp_control_signal_handler (omapi_object_t *h,
512
513
                                        const char *name, va_list ap)
513
514
{
514
 
        dhcp_control_object_t *control;
 
515
        /* In this function h should be a (dhcp_control_object_t *) */
 
516
 
515
517
        isc_result_t status;
516
518
 
517
519
        if (h -> type != dhcp_type_control)
518
520
                return DHCP_R_INVALIDARG;
519
 
        control = (dhcp_control_object_t *)h;
520
521
 
521
522
        /* Try to find some inner object that can take the value. */
522
523
        if (h -> inner && h -> inner -> type -> get_value) {
572
573
                status = omapi_get_value_str (ref, id, "handle", &tv);
573
574
                if (status == ISC_R_SUCCESS) {
574
575
                        status = omapi_handle_td_lookup (lp, tv -> value);
575
 
                        
 
576
 
576
577
                        omapi_value_dereference (&tv, MDL);
577
578
                        if (status != ISC_R_SUCCESS)
578
579
                                return status;
579
 
                        
 
580
 
580
581
                        /* Don't return the object if the type is wrong. */
581
582
                        if ((*lp) -> type != dhcp_type_control) {
582
583
                                omapi_object_dereference (lp, MDL);
612
613
                                     omapi_data_string_t *name,
613
614
                                     omapi_typed_data_t *value)
614
615
{
615
 
        struct subnet *subnet;
 
616
        /* In this function h should be a (struct subnet *) */
 
617
 
616
618
        isc_result_t status;
617
619
 
618
620
        if (h -> type != dhcp_type_subnet)
619
621
                return DHCP_R_INVALIDARG;
620
 
        subnet = (struct subnet *)h;
621
622
 
622
623
        /* No values to set yet. */
623
624
 
628
629
                if (status == ISC_R_SUCCESS || status == DHCP_R_UNCHANGED)
629
630
                        return status;
630
631
        }
631
 
                          
 
632
 
632
633
        return ISC_R_NOTFOUND;
633
634
}
634
635
 
637
638
                                    omapi_data_string_t *name,
638
639
                                    omapi_value_t **value)
639
640
{
640
 
        struct subnet *subnet;
 
641
        /* In this function h should be a (struct subnet *) */
 
642
 
641
643
        isc_result_t status;
642
644
 
643
645
        if (h -> type != dhcp_type_subnet)
644
646
                return DHCP_R_INVALIDARG;
645
 
        subnet = (struct subnet *)h;
646
647
 
647
648
        /* No values to get yet. */
648
649
 
658
659
 
659
660
isc_result_t dhcp_subnet_destroy (omapi_object_t *h, const char *file, int line)
660
661
{
 
662
#if defined (DEBUG_MEMORY_LEAKAGE) || \
 
663
                defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
661
664
        struct subnet *subnet;
 
665
#endif
662
666
 
663
667
        if (h -> type != dhcp_type_subnet)
664
668
                return DHCP_R_INVALIDARG;
 
669
 
 
670
#if defined (DEBUG_MEMORY_LEAKAGE) || \
 
671
                defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
665
672
        subnet = (struct subnet *)h;
666
 
 
667
 
#if defined (DEBUG_MEMORY_LEAKAGE) || \
668
 
                defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
669
673
        if (subnet -> next_subnet)
670
674
                subnet_dereference (&subnet -> next_subnet, file, line);
671
675
        if (subnet -> next_sibling)
685
689
isc_result_t dhcp_subnet_signal_handler (omapi_object_t *h,
686
690
                                         const char *name, va_list ap)
687
691
{
688
 
        struct subnet *subnet;
 
692
        /* In this function h should be a (struct subnet *) */
 
693
 
689
694
        isc_result_t status;
690
695
        int updatep = 0;
691
696
 
692
697
        if (h -> type != dhcp_type_subnet)
693
698
                return DHCP_R_INVALIDARG;
694
 
        subnet = (struct subnet *)h;
695
699
 
696
700
        /* Can't write subnets yet. */
697
701
 
711
715
                                       omapi_object_t *id,
712
716
                                       omapi_object_t *h)
713
717
{
714
 
        struct subnet *subnet;
 
718
        /* In this function h should be a (struct subnet *) */
 
719
 
715
720
        isc_result_t status;
716
721
 
717
722
        if (h -> type != dhcp_type_subnet)
718
723
                return DHCP_R_INVALIDARG;
719
 
        subnet = (struct subnet *)h;
720
724
 
721
725
        /* Can't stuff subnet values yet. */
722
726
 
761
765
                                             omapi_data_string_t *name,
762
766
                                             omapi_typed_data_t *value)
763
767
{
764
 
        struct shared_network *shared_network;
 
768
        /* In this function h should be a (struct shared_network *) */
 
769
 
765
770
        isc_result_t status;
766
771
 
767
772
        if (h -> type != dhcp_type_shared_network)
768
773
                return DHCP_R_INVALIDARG;
769
 
        shared_network = (struct shared_network *)h;
770
774
 
771
775
        /* No values to set yet. */
772
776
 
777
781
                if (status == ISC_R_SUCCESS || status == DHCP_R_UNCHANGED)
778
782
                        return status;
779
783
        }
780
 
                          
 
784
 
781
785
        return ISC_R_NOTFOUND;
782
786
}
783
787
 
787
791
                                            omapi_data_string_t *name,
788
792
                                            omapi_value_t **value)
789
793
{
790
 
        struct shared_network *shared_network;
 
794
        /* In this function h should be a (struct shared_network *) */
 
795
 
791
796
        isc_result_t status;
792
797
 
793
798
        if (h -> type != dhcp_type_shared_network)
794
799
                return DHCP_R_INVALIDARG;
795
 
        shared_network = (struct shared_network *)h;
796
800
 
797
801
        /* No values to get yet. */
798
802
 
809
813
isc_result_t dhcp_shared_network_destroy (omapi_object_t *h,
810
814
                                          const char *file, int line)
811
815
{
 
816
        /* In this function h should be a (struct shared_network *) */
 
817
 
 
818
#if defined (DEBUG_MEMORY_LEAKAGE) || \
 
819
    defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
812
820
        struct shared_network *shared_network;
 
821
#endif
813
822
 
814
823
        if (h -> type != dhcp_type_shared_network)
815
824
                return DHCP_R_INVALIDARG;
 
825
 
 
826
#if defined (DEBUG_MEMORY_LEAKAGE) || \
 
827
                defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
816
828
        shared_network = (struct shared_network *)h;
817
 
 
818
 
#if defined (DEBUG_MEMORY_LEAKAGE) || \
819
 
                defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
820
829
        if (shared_network -> next)
821
830
                shared_network_dereference (&shared_network -> next,
822
831
                                            file, line);
849
858
                                                 const char *name,
850
859
                                                 va_list ap)
851
860
{
852
 
        struct shared_network *shared_network;
 
861
        /* In this function h should be a (struct shared_network *) */
 
862
 
853
863
        isc_result_t status;
854
864
        int updatep = 0;
855
865
 
856
866
        if (h -> type != dhcp_type_shared_network)
857
867
                return DHCP_R_INVALIDARG;
858
 
        shared_network = (struct shared_network *)h;
859
868
 
860
869
        /* Can't write shared_networks yet. */
861
870
 
875
884
                                               omapi_object_t *id,
876
885
                                               omapi_object_t *h)
877
886
{
878
 
        struct shared_network *shared_network;
 
887
        /* In this function h should be a (struct shared_network *) */
 
888
 
879
889
        isc_result_t status;
880
890
 
881
891
        if (h -> type != dhcp_type_shared_network)
882
892
                return DHCP_R_INVALIDARG;
883
 
        shared_network = (struct shared_network *)h;
884
893
 
885
894
        /* Can't stuff shared_network values yet. */
886
895